Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想转换[#xC0-#xD6]为JavaCC语法。我试过了["\uC0"-"\uD6"],但我收到了这个错误:
[#xC0-#xD6]
JavaCC
["\uC0"-"\uD6"]
Exception in thread "main" java.lang.Error: Invalid escape character.
谢谢你。
你可以试试这个正则表达式:
[\\u00C0-\\u00D6]
字符类中不需要引号。
您需要转义转义字符。Java 不知道是什么"\u"意思,所以你需要"\\u"。
"\u"
"\\u"