Uploaded image for project: 'Commons Net'
  1. Commons Net
  2. NET-526

Avoid greedy matches within a regex

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.4
    • Component/s: None
    • Labels:
      None

      Description

      Some of the FTP directory parsers use greedy qualifiers - ".*" - within a regex.

      This can be expensive, as it may require backtracking.
      It's usually better to use a reluctant qualifier - e.g. ".*?" - except at the end of an RE.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              sebb@apache.org Sebb
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: