-
Bug
-
Resolution: Unresolved
-
P4
-
8, 11, 17, 21, 23
-
None
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.
- csr for
-
JDK-8230675 Pattern for a control-char matches non-control characters
-
- Draft
-
- links to