In java, I'm trying to detect strings of the form: optional underline, capital letters, and then curly brackets encasing two parameters. I.e. things like MAX{1,2}
FUNC{3,7}
_POW{9,10}
I've decided to put off dealing with the parameters until later, so the regex I'm using is:
_?[A-Z]+//{.*//}
But I'm getting the following error when trying to compile it into a Pattern object:
Exception in thread "main" java.util.regex.PatternSyntaxException: Illegal repetition near index 9
_?[A-Z]+//{.*//}
^
Anyone know what the problem is?