Matches or replaces text using .NET regular-expression syntax instead of PCRE2.
These functions are exported by the KS module.
FoundPos := RegExMatchCs(Haystack, NeedleRegEx , &OutputVar, StartingPos := 1) NewStr := RegExReplaceCs(Haystack, NeedleRegEx , Replacement := "", &OutputVarCount, Limit := -1, StartingPos := 1)
The general parameter and return conventions match RegExMatch and RegExReplace. RegExMatchCs writes a RegExMatchInfo object. An invalid pattern throws an Error whose Extra is the .NET error message.
A StartingPos below 1 selects a right-to-left search. With 0, the search currently starts at index 0 rather than the end of the string; this limits the matches it can find.
Replacement is converted to a string; a function replacement is not supported.
S and X are accepted and have no effect.A anchors at the beginning of Haystack, rather than at StartingPos.C, D and U, the newline options, PCRE newline escapes and \K are unavailable.$ matches before `n but not before `r`n; use \r?$ for CRLF text.See Microsoft's .NET regular expressions guide.