Skip to content

Java/JS regex support for escapes within charclasses, JS regex null escape, identity escapes & legacy octal escape#1501

Open
lmasroca wants to merge 31 commits intomasterfrom
regex-support-extension
Open

Java/JS regex support for escapes within charclasses, JS regex null escape, identity escapes & legacy octal escape#1501
lmasroca wants to merge 31 commits intomasterfrom
regex-support-extension

Conversation

@lmasroca
Copy link
Copy Markdown
Collaborator

Java/JS regex support for some escapes within character classes ([\s\S], etc.)
JS regex support for null escape (\0), identity escapes (\a, etc.), legacy octal escapes (\1, \012, \377, etc.) and fix for control letter escapes (different behavior regarding inside character class among other things)

lmasroca and others added 24 commits December 16, 2025 15:44
…sion

# Conflicts:
#	core/src/main/kotlin/org/evomaster/core/parser/GeneRegexJavaVisitor.kt
#	core/src/test/kotlin/org/evomaster/core/parser/RegexHandlerTest.kt
…sion

# Conflicts:
#	core-tests/e2e-tests/spring/emb-json/src/test/java/org/evomaster/e2etests/emb/json/language/LanguageServerExampleEMTest.java
#	core/src/main/antlr4/org/evomaster/core/parser/RegexJava.g4
#	core/src/main/kotlin/org/evomaster/core/parser/GeneRegexJavaVisitor.kt
#	core/src/main/kotlin/org/evomaster/core/search/gene/regex/CharacterClassEscapeRxGene.kt
#	core/src/main/kotlin/org/evomaster/core/search/gene/regex/CharacterRangeRxGene.kt
#	core/src/main/kotlin/org/evomaster/core/search/service/Randomness.kt
@lmasroca lmasroca requested a review from jgaleotti April 13, 2026 19:34
| SLASH IdentityEscape
;

//TODO backreferences
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

explain in this comment a bit more what backreferences are

//// | 'b'
// //| CharacterEscape
// ;
// TODO
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is this TODO?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was for \b within charclass, in JS some escapes behave differently within charclasses. In the case of \b within charclass it is interpreted as backspace. Implemented that now and removed TODO. The \b and \B escapes outside charclass (word boundary assertions) are not implemented yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants