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)