正则表达式匹配每个字符,但以下字符 [英] Regex match every char but the following
本文介绍了正则表达式匹配每个字符,但以下字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您能帮我建立一个正则表达式,使其匹配除[a-zA-Z][\w:.-]
所匹配的字符以外的所有内容吗?
Can you help me to build a regex that match everything but the characters matched by [a-zA-Z][\w:.-]
?
例如:在测试字符串abc)def
中,)
应该是最终正则表达式的匹配字符.
For example: in the test string abc)def
the )
should be a matched char for the final regex.
我尝试使用正则表达式(?!fox\b)\b\w+
的几种变体(请参见),没有任何结果.
I tried using several variations of the regex (?!fox\b)\b\w+
(see) without any result.
为简化测试,您可以使用此服务.
For easy the test you can use this service.
推荐答案
对不起,看来我忽略了这个问题.
Sorry, it seems that I overlook the issue.
答案是:
[^a-zA-Z\w:.-]
谢谢!
这篇关于正则表达式匹配每个字符,但以下字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文