Pregunta

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.

¿Fue útil?

Solución

You can try this regex:

[\\u00C0-\\u00D6]

quotes are not needed inside character class.

Otros consejos

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

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top