On 25 May 2004 23:01:17 -0700,
(DemmeGod) wrote:
>Does anyone know why the following regex:
>class \S*|\S* \S*\([^;]*\)\s*{
>
>Gives me this exception:
>java.util.regex.PatternSyntaxException: Illegal repetition near index 28
>
>Index 28 is the 's' in "\s". I'm just trying to allow for whitespace.
>
>Thanks
The problem has to be the open brace at the end. If you don't escape
it like you did the parentheses, the compiler expects to see a {m,n}
type quantifier. By my count, that's index 29; looks like the
compiler miscounted.