如何在RE2中为“匹配不以4或5开头的字符串”编写正则表达式?
在PCRE中,我会使用^(?!4),但使用RE2 doesn't support that syntax。
^(?!4)
发布于 2015-01-29 00:24:06
您可以使用此正则表达式:
^[^45]
^匹配start,而[^45]匹配除4或5之外的任何内容。
^
[^45]
4
5
https://stackoverflow.com/questions/28197269
相似问题