作为更大的解析器的一部分,我正在编写一个规则来匹配字符串,如使用parboiled2:
意大利莱尔
我想用一些简单的方法,例如:
CharPredicate.Printable但是解析器在org.parboiled2.ParseError中失败了,因为字符串末尾有unicode字符。
对于匹配可打印的unicode字符,是否有一个我不知道的简单选项?
发布于 2015-01-16 23:43:16
看看https://github.com/sirthias/parboiled2/blob/master/parboiled-core/src/main/scala/org/parboiled2/CharPredicate.scala#L112 --做自己的谓词非常容易,例如:
val latinSupplementCharsPredicate = CharPredicate('\u00c0' to '\u00dc') ++ CharPredicate('\u00e0' to '\u00fd')https://stackoverflow.com/questions/27994297
复制相似问题