andgineer / TRegExpr

Regular expressions (regex), pascal.
https://regex.sorokin.engineer/en/latest/
MIT License
174 stars 63 forks source link

UnQuoteChar can't be called from TRegExpr.Substitute #266

Closed delphicz closed 2 years ago

delphicz commented 2 years ago

You try using unQuoteChar inside TRegExpr.Substitute, so using unQuoteChar on template sometimes fail on if APtr >= fRegexEnd for example with error Error(reeNoHexCodeAfterBSlashX); just because fRegexEnd doesn't have nothing in common with passed template.

proposed fix: function TRegExpr.UnQuoteChar(var APtr: PRegExprChar; var pEnd: PRegExprChar): REChar;

and pass fRegexEnd or TemplateEnd and check for pEnd