Regular expressions
Lexer engine uses regex from EControl package. Groups must be referenced as \0 .. \9.It has custom features:
- classes \A, \Z: begin/end of file
- look ahead/behind can find variable length
- does NOT support non-capturing groups, big drawback when you want to do complex replacements
- Note: This can almost always be worked around by simply capturing undesired groups and including their alias ($1, $2, etc.) in the replace field: https://regex.sorokin.engineer/en/latest/regular_expressions.html#lookahead
- new modifiers (?r), (?g)
Search/replace uses TRegExpr engine (by Sorokin), almost fully Perl compatible, syntax is documented here: https://regex.sorokin.engineer/en/latest/regular_expressions.html . Groups must be referenced as $0 .. $9. Engine is more reliable, fast.
Change case on replaces
With regex, you can change case of found fragments, use modifiers in replace-with field:
- \l - First char to lower
- \L - All chars to lower
- \u - First char to upper
- \U - All chars to upper
E.g. if found a word, use replace-with field "\L$0" to change word to lowercase (here $0 is group 0, found text).
Modifiers affect only element after them, element is:
- one char (not string), so "\Uabc" and "\uabc" give same result "Abc" (only one char changed),
- or group $0 … $9, so modifier changes case of this group (not only one char).