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

Pattern for a control-char matches non-control characters

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3
    • None
    • None
    • core-libs
    • 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.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              igerasim Ivan Gerasimov
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: