grammars-v4 icon indicating copy to clipboard operation
grammars-v4 copied to clipboard

xsd-regex should not treat '{' as a normal Char

Open alex-lx opened this issue 5 years ago • 2 comments

In regexLexer.g4, it says:

Char : ~('.' | '\\' | '?' | '*' | '+' | '(' | ')' | '|' | '[' | ']')

which don't exclude '{', which makes the lexer treat '{' as a normal Char.

e.g.a{1}

alex-lx avatar Jan 19 '20 09:01 alex-lx

https://regex101.com/r/R7NJ4r/1/

FYI

ghost avatar Jan 22 '20 10:01 ghost

I'm hitting the same problem.

x{0} parses as 4 atoms, but should parse as one atom and a quantifier.

Adding the curly braces to

Char : ~('.' | '\\' | '?' | '*' | '+' | '(' | ')' | '|' | '[' | ']' | '{' | '}')

does appear to fix the problem.

richardjwilson avatar Feb 10 '23 16:02 richardjwilson