Uploaded image for project: 'ICU'
  1. ICU-6080

Regexp, Allow Quantifiers on zero-length tests?

    Details

    • Type: Enhancement
    • Status: Accepted (View workflow)
    • Priority: minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: regexp
    • Labels:
      None
    • Time Needed:
      Days
    • tracOwner:
      andy
    • tracProject:
      ICU4C
    • tracReporter:
      andy
    • tracStatus:
      accepted
    • tracWeeks:
      0.5

      Description

      Allow quantifiers on zero-length tests?

      This is a Java compatibility question.
      Java allows things like "`^`" or "\b" to appear in patterns.
      It doesn't make any sense to repeat a test for being on a boundary position; any appearances of these constructs in patterns probably are an error or a misunderstanding by the author of the pattern.

      ICU started to match Java, with quantifiers allowed on '`^`' and '$'. But there are many more, including look-ahead and look-behind.

      ICU should be consistent with itself, and either allow these everywhere, or disallow them everywhere. Disallow seems best -

      • They don't do anything useful, and are likely user errors.
      • Allowing would require care, to avoid any possibility of sending the match engine
        into a loop on the zero length (no progress) match.

      Historically, ICU dis-allowed these.

        Attachments

          Activity

            People

            • Assignee:
              andy.heninger Andy Heninger
              Reporter:
              andy.heninger Andy Heninger
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                tracCreated: