Support nested POSIX classes ([[:alpha:]]) in RE and add Character helper APIs; expand regex tests#4598
Merged
shai-almog merged 1 commit intomasterfrom Mar 6, 2026
Conversation
✅ Continuous Quality ReportTest & Coverage
Static Analysis
Generated automatically by the PR CI workflow. |
Collaborator
Author
|
Compared 32 screenshots: 32 matched. Native Android coverage
✅ Native Android screenshot tests passed. Native Android coverage
|
✅ ByteCodeTranslator Quality ReportTest & Coverage
Benchmark Results
Static Analysis
Generated automatically by the PR CI workflow. |
Collaborator
Author
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.

Motivation
REengine did not recognize the standard nested POSIX character-class form like[[:alpha:]], so patterns such asRE("list [[:alpha:]]*")failed to work.Description
[:class:]and nested[[:class:]]POSIX character-class forms inRECompilerby introducingparsePosixCharacterClass(...)and wiring detection for the two forms incharacterClass()(file:CodenameOne/src/com/codename1/util/regex/RECompiler.java).isAlpha(char|int),isNumeric(char|int), andisAlphaNumeric(char|int)(file:vm/JavaAPI/src/java/lang/Character.java).isAlpha(char),isNumeric(char), andisAlphaNumeric(char)so the methods exist in the CLDC11 API (file:Ports/CLDC11/src/java/lang/Character.java).RETestwith coverage for nested POSIX classes, legacy[:alpha:]behavior, and additional POSIX classes and escapes (alnum,digit,xdigit,\w,\s,\d) (file:maven/core-unittests/src/test/java/com/codename1/util/regex/RETest.java).Testing
cd maven && mvn -pl core-unittests -am -DunitTests=true -Dmaven.javadoc.skip=true -DfailIfNoTests=false test -Dtest=com.codename1.util.regex.RETestand the updatedRETestsuite ran and passed (5 tests, 0 failures).local-dev-javaseprofile and the JDK path noted in repository documentation), so the final verification used the project test invocation above and completed successfully.Codex Task