Repository navigation
JVM: leading \b before non-word alternation members (java .matches(, kotlin !is, scala !ptr) (Part of #7863) - #7864
Merged
Conversation
…kotlin !is, scala !ptr) (Part of #7863) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Contributor
|
No description provided. |
Contributor
|
No description provided. |
Contributor
This was referenced Nov 6, 2026
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.
Part of #7863 (siblings of #4108). Fixes the JVM-family members of the leading-
\bclass: an alternation member that starts with a non-word char behind a\bcannot match after whitespace or punctuation.Checklist: done [c:6b972545]
Checklist: done [c:3c034a22]
Checklist: done [c:4d32b99d]
What changed
One read per site (line numbers in the issue had drifted; found by scan):
java.pyregex_execution:\b(Pattern\.compile|Matcher\.find|\.matches\()\b.\bbefore\.matchesonly matched after a word char, and the trailing\bafter(needed a word char next, so"abc".matches("a.c"),f().matches(re)anda\n.matches(re)were all missed. Now\b(?:Pattern\.compile|Matcher\.find)\b|\.matches\(. Not a dash flag, so no(?<![\w-]): that would have brokens.matches(.kotlin.pysafety:!isbehind\bnever matched after a space. Moved to(?<![\w-])!is. Count-neutral:isalready matched insidex !is T, and the new match consumes the same text, so it counts once (tested).scala.pypointers:!ptr(Scala Native dereference) behind\bnever matched. Moved to(?<![\w-])!ptr; the word-start members keep\b.Class / Sibling gaps
Class: leading
\b(...)before an alternation member starting with a non-word char. Members in this PR: java, kotlin, scala (above). Tests per input class intests/extraction/languages/test_jvm_dash_flag_boundary_7863.py: after word char / quote / paren / whitespace, positive and negative, count-once.Sibling gaps (not touched, different languages, own read each; issue #7863 checklist): agc_assembly.py:245, assembly.py:383, csharp.py:600, go.py:550, javascript.py:378, lua.py:289, ruby.py:308, swift.py:475, dart.py:170 and :386, dockerfile
skipTestsvs-DskipTests.Remaining slices: none for the JVM family. Other languages as listed, grouped a few per PR.
Evidence
test_{java,kotlin,scala}_strict.pyplus the new file: all pass.golden-lock.sh crucible_check.py(both legs): PASS, zero drift, no bless needed.ruff formatclean on the 4 files. Not run:pr_gates --fast/--ratchets, full suite (CI's job; filler slice).🤖 Generated with Claude Code