-
Notifications
You must be signed in to change notification settings - Fork 240
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Regexp: Transpile \D
, \W
to Java's definitions
#5575
Merged
andygrove
merged 16 commits into
NVIDIA:branch-22.06
from
andygrove:regexp-digit-word-upper
May 27, 2022
Merged
Regexp: Transpile \D
, \W
to Java's definitions
#5575
andygrove
merged 16 commits into
NVIDIA:branch-22.06
from
andygrove:regexp-digit-word-upper
May 27, 2022
Conversation
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
Signed-off-by: Andy Grove <andygrove@nvidia.com>
Signed-off-by: Andy Grove <andygrove@nvidia.com>
andygrove
force-pushed
the
regexp-digit-word-upper
branch
from
May 20, 2022 18:38
628e81c
to
2a28d89
Compare
andygrove
changed the title
WIP: Regexp: Add support for
Regexp: Transpile May 20, 2022
\D
and \W
\D
, \W
to Java's definitions
andygrove
changed the title
Regexp: Transpile
WIP: Regexp: Transpile May 20, 2022
\D
, \W
to Java's definitions\D
, \W
to Java's definitions
build |
andygrove
commented
May 24, 2022
|
||
// this check is quite broad and could potentially be refined to look for \W or \D | ||
// immediately next to a line anchor | ||
if (negatedWordOrDigit && endOfLineAnchor) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a follow-on PR #5610 to refine the approach taken here
andygrove
commented
May 24, 2022
@@ -74,6 +74,15 @@ class RegularExpressionTranspilerSuite extends FunSuite with Arm { | |||
} | |||
} | |||
|
|||
test("Detect unsupported combinations of line anchors and \\W and \\D") { | |||
val patterns = Seq("\\W\\Z\\D", "\\W$", "$\\D") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These patterns were found during fuzz testing
andygrove
changed the title
WIP: Regexp: Transpile
Regexp: Transpile May 24, 2022
\D
, \W
to Java's definitions\D
, \W
to Java's definitions
anthony-chang
previously approved these changes
May 24, 2022
build |
build |
anthony-chang
approved these changes
May 26, 2022
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 #5547
Adds support for
\D
and\W
by transpiling to[^0-9]
and[^a-zA-Z_0-9]
to match Java's definition.