1
到Regex - Find all matching words that that don't begin with a specific prefix类似的开始,也可以是类似Regex for matching whole words that contain dots正则表达式 - 寻找匹配的词和点不以前缀
我需要找到一个不以“com.
”启动“somehost
”的所有实例
具体来说,我期待改变“某”的情况下,在address
而不是contract
:
<endpoint address="https://subsite.somehost.com/someservice.svc" ...
contract="com.somehost.subsite.someservice.MyServiceSoap" />
<endpoint address="https://othersub.somehost.com/anotherservice.svc" ...
contract="com.somehost.othersub.anotherservice.MyOtherServiceSoap" />
适应T中的“(未女孩)朋友”的例子他first linked question,我已经试过:
\b(?!com\.)[\w\.]*somehost\b
将匹配subsite.somehost
,othersub.somehost
和.somehost
,也不会在所有帮助,如果我想只需更换somehost
部分。貌似期(.
)被拧的事情了......
(在我的情况,我有机会获得lookbehinds)