You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fixes#24 changes $ behavior in singleline when using RE2 and ECMAScript modes
PCRE and .NET have a different definition of $ than RE2 and ECMAScript
engines in singleline mode. PCRE defines it as "$ asserts position at the end
of the string, or before the line terminator right at the end of the string (if any)."
This means that a pattern of "^ac$\n" is valid and can match "ac\n" OR "ac".
This behavior is different in RE2 and ECMAScript engines. For these engines the
pattern "^ac$\n" won't match any inputs in singleline mode because the $ demands the
string ends but the pattern requires an extra \n so they both cannot be true.
The PCRE/.NET behavior feels wrong, but for this project I maintain compatibility with
them in "default" mode. The other, less suprising behavior is enabled by using either
the RE2 option or the ECMAScript option.
0 commit comments