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 RegExMatchInfoCs object, which provides the same match-information interface using .NET groups. Invalid patterns throw .NET regular-expression exceptions rather than PCRE exceptions.
That interface includes every member of a PCRE match object, among them Success, which is 1 when the pattern matched and 0 otherwise, and ToString(), which returns the position of the overall match.
A is unavailable; use ^ or \A.C is unavailable; iterate matches explicitly.D is unavailable. $ matches before \n; use \r?$ for CRLF.J is unavailable.S is unnecessary; expressions are compiled.U is unavailable; append ? to a quantifier.X, PCRE newline escapes and \K are unavailable. A lookbehind such as (?<=abc) can replace some uses of \K.See Microsoft's .NET regular expressions guide.