Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regular expression (regex / regexp) replace function #16461

Open
ohads-MSFT opened this issue Feb 23, 2025 · 1 comment
Open

Regular expression (regex / regexp) replace function #16461

ohads-MSFT opened this issue Feb 23, 2025 · 1 comment
Labels
enhancement New feature or request intermediate language Related to the intermediate language new function

Comments

@ohads-MSFT
Copy link

ohads-MSFT commented Feb 23, 2025

Is your feature request related to a problem? Please describe.
replace is useful, but sometimes simple string replacements aren't enough and one needs regular expressions replacements.

Describe the solution you'd like
A function like replaceRegex with a signature similar to what we have in .NET: public static string Replace(string input, string pattern, string replacement, System.Text.RegularExpressions.RegexOptions options)
https://learn.microsoft.com/en-us/dotnet/api/system.text.regularexpressions.regex.replace?view=net-9.0#system-text-regularexpressions-regex-replace(system-string-system-string-system-string-system-text-regularexpressions-regexoptions

It can also help with multiple replacements as requested here: #5703

@ohads-MSFT ohads-MSFT added the enhancement New feature or request label Feb 23, 2025
@github-project-automation github-project-automation bot moved this to Todo in Bicep Feb 23, 2025
@jeskew jeskew added intermediate language Related to the intermediate language new function labels Feb 25, 2025
@jeskew
Copy link
Member

jeskew commented Feb 25, 2025

Like with #8409, adding any function that acts on a user-supplied regular expression is likely blocked on the backend migrating to .NET 7+ since the non-backtracking engine was not backported to .NET standard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request intermediate language Related to the intermediate language new function
Projects
Status: Todo
Development

No branches or pull requests

3 participants