java - how to represent full Unicode range in regexp in JFlex? - Stack Overflow

Is it possible in the current version of JFlex (1.9.1) to represent a range of full Unicode values in a

Is it possible in the current version of JFlex (1.9.1) to represent a range of full Unicode values in a regular expression ?

Something like this:

UnicodeIdentifier = [a-zA-Z_\u007F-\u10FFFF] [a-zA-Z0-9_\u007F-\u10FFFF]*

except this does not work (and makes JFlex emit a warning) because Unicode escape sequences in Java must be 16 bits in hexadecimal so the high end would be treated as \u10FF.

The spec says that representing supplementary characters in the range U+010000 to U+10FFFF requires two consecutive Unicode escapes however using this:

UnicodeIdentifier = [a-zA-Z_\u007F-\uDBFF\uDFFF] [a-zA-Z0-9_\u007F-\uDBFF\uDFFF]*

does not work either.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744935962a4602024.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信