Pergunta

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.

Foi útil?

Solução

You can try this regex:

[\\u00C0-\\u00D6]

quotes are not needed inside character class.

Outras dicas

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

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top