Eclipse says there is illegal repetition in this regular expression

if(possTape.matches("{\\(\\d+,\"[^:=;@\"\\)\\(\\{\\}\\[\\]]+\"\\)(,\\(\\d+,\"[^:=;@\"\\)\\(\\{\\}\\[\\]]+\"\\))+}"))

But what does this mean? I tested this regex on regexpal (with settings made so that it works like Java), but I can't see where there is illegal repetition?

+5
source share
1 answer

avoid braces?

According to this answer :

{and} are special in the Java regex dialect (and most other dialects): these are opening and closing tokens for the repetition quantifier {n, m}, where n and m are integers. From here the error message: "Illegal repetition" appears.

+8
source

All Articles