Query Details
// this code can be substituted by regex_quote()
let _StringToRegEx = toscalar(
_GetWatchlist('RegEx-SingleRegularExpressions')
| where UseCase == "StringToRegEx"
| project RegEx
);
// ...
| project RegEx = replace_regex(ToReplace, _StringToRegEx, @"\\\1")
This query is using the Kusto Query Language (KQL) to replace a specific pattern in a string with a regular expression. It first retrieves the regular expression from a watchlist, then uses the "replace_regex" function to perform the replacement. The result is a modified string with the pattern replaced.

Jose Sebastián Canós
Released: March 7, 2023
Tables
Keywords
Operators