hoaproject / Regex

The Hoa\Regex library.
https://hoa-project.net/
310 stars 17 forks source link

Incorrect handling of dashes inside character classes #31

Open ju1ius opened 6 years ago

ju1ius commented 6 years ago

Hi again :wink:,

Parsing the pattern [\w-] throws Unexpected token "-" (range) at line 1 and column 4. When encountered at the last position of a character class, a dash should produce a token with the value "-".

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/53869337-incorrect-handling-of-dashes-inside-character-classes?utm_campaign=plugin&utm_content=tracker%2F6167031&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F6167031&utm_medium=issues&utm_source=github).
Hywan commented 6 years ago

Thanks for the report!

https://github.com/hoaproject/Regex/pull/33/commits/e770ada2e9f52b86c8c52f5eb12f3c4b3f9dbd0f fixes the issue. Can you test on your use case please?