Details
-
Bug
-
Resolution: Unresolved
-
P3
-
None
-
None
-
None
Description
Regexp pattern allow \\cx sequence to specify control-x character.
Current implementation has two issues:
1) It allows x to be any character, including non-ASCII and non-printable ones;
For example, it is possible to have "\\c ", which will match "`".
2) It allows to construct a regexp that will match non-control characters;
For example "\\c`" will match " " (and the space char is not control-char).
Another thing that should also be reviewed is that x is currently case-sensitive.
For reference, perl treats \cA and \ca equally, and both regexps match ^A control-char.
Current implementation has two issues:
1) It allows x to be any character, including non-ASCII and non-printable ones;
For example, it is possible to have "\\c ", which will match "`".
2) It allows to construct a regexp that will match non-control characters;
For example "\\c`" will match " " (and the space char is not control-char).
Another thing that should also be reviewed is that x is currently case-sensitive.
For reference, perl treats \cA and \ca equally, and both regexps match ^A control-char.
Attachments
Issue Links
- csr for
-
JDK-8230675 Pattern for a control-char matches non-control characters
- Draft
- links to