Fix matching of $ when there are trailing newlines#1201
Merged
stevehu merged 1 commit intonetworknt:masterfrom Oct 20, 2025
Merged
Fix matching of $ when there are trailing newlines#1201stevehu merged 1 commit intonetworknt:masterfrom
stevehu merged 1 commit intonetworknt:masterfrom
Conversation
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1201 +/- ##
============================================
- Coverage 78.90% 77.97% -0.93%
+ Complexity 1965 1923 -42
============================================
Files 172 200 +28
Lines 6352 6730 +378
Branches 1255 1188 -67
============================================
+ Hits 5012 5248 +236
- Misses 867 1040 +173
+ Partials 473 442 -31 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
stevehu
approved these changes
Oct 20, 2025
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #495
This updates the Joni and JDK RegularExpression to treat the
$anchor in the same way as ECMAScript.This needed to update the pattern itself, namely replacing the
$anchor for\zThe underlying issue being that the semantic meaning of$for Joni and JDK is different from ECMAScript in that it allows trailing newlines. The meaning of\zis closer to what$means for ECMAScript.It's not possible for Joni to support this without changes to their code, this is actually determined in their Lexer. What is needed is
AnchorType.END_BUFbut for$whether it's singleline or multiline only toggles betweenAnchorType.SEMI_END_BUFandAnchorType.END_LINE.This also updates JDK RegularExpression to be able to accept the long form Unicode Character properties that ECMAScript also accepts.