Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8230365

Pattern for a control-char matches non-control characters

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 8, 11, 17, 21, 23
    • core-libs
    • 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.

            rgiulietti Raffaello Giulietti
            igerasim Ivan Gerasimov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: