Skip to content

Composite character ranges #85

@dazinator

Description

@dazinator

At the moment dotnet.glob supports either number or letter ranges in patterns, e.g

  • [A-Z]
  • [1-9]

However the Unix etc glob library supports a composite form of range expression:

[A-Fa-f0-9]

Ranges

   There is one special convention: two characters separated by '-'
   denote a range.  (Thus, "[A-Fa-f0-9]" is equivalent to
   "[ABCDEFabcdef0123456789]".)  One may include '-' in its literal
   meaning by making it the first or last character between the
   brackets.  (Thus, "[]-]" matches just the two characters ']' and
   '-', and "[--0]" matches the three characters '-', '.', '0',
   since '/' cannot be matched.)

Support for this could be implemented, and as far as I can see it wouldn't introduce any breaking behavioural changes as people don't have to use this pattern. I would perhaps implement new range tokens for this extended form

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions