ammar / regexp_parser

A regular expression parser library for Ruby
MIT License
143 stars 22 forks source link

Escape sequences not handled correctly in character classes #5

Closed camertron closed 10 years ago

camertron commented 10 years ago

It looks like [\da-z] results in an incorrect members array in CharacterSet. Consider the following example:

Regexp::Parser.parse('[\da-z]').expressions.first.members
# => ["\\da", "-", "z"]

I think the array should contain a Digit object or '0-9' instead of the '\\d'.

ammar commented 10 years ago

Good catch. Thanks for the report.

I will be checking in a fix shortly but it might be a few more days before I make a new release.