不区分大小写的 Scala 解析器组合器
I'm trying to create a language, and there are some parts of it that I want to be case insensitive. I'm sure this is something easy, but I haven't been able to find it.
Edit:
Re-reading makes me ashamed of this question. Here is a failing test that explains what I mean.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用正则表达式而不是文字。
(请参阅 java.util 的文档。 Pattern 有关所使用的正则表达式语法的信息。)
如果您经常这样做,您可以 pimp String 来简化语法:
Use a regular expression instead of a literal.
(See the docs for java.util.Pattern for info on the regex syntax used.)
If you're doing this frequently you could pimp String to simplify the syntax: