-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixes #24 changes $ behavior in singleline when using RE2 and ECMAScr…
…ipt 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.
- Loading branch information
Showing
3 changed files
with
56 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters