mysticatea / regexpp

The regular expression parser for ECMAScript.
MIT License
153 stars 15 forks source link

Throw on explicit quantifier when min > max #21

Closed conartist6 closed 3 years ago

conartist6 commented 3 years ago

This matches the behavior of builtin regex

ota-meshi commented 3 years ago

Which API are you using? I think the following source code will throw the error correctly.

parseRegExpLiteral("/a{1,0}/")
// SyntaxError: Invalid regular expression: /a{1,0}/: numbers out of order in {} quantifier
conartist6 commented 3 years ago

To be honest I don't remember anymore. I sure didn't give very much information did I? Let's close this and I'll reopen if I ever figure out what specifically my problem was.