Question

I want to convert [#xC0-#xD6] to JavaCC syntax. I've tried with ["\uC0"-"\uD6"], but i get this error:

Exception in thread "main" java.lang.Error: Invalid escape character.

Thank you.

Was it helpful?

Solution

You can try this regex:

[\\u00C0-\\u00D6]

quotes are not needed inside character class.

OTHER TIPS

You need to escape the escape character. Java doesn't know what "\u" means so you need "\\u" instead.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top