从起始分隔符到结束分隔符匹配(Regex/pattern 匹配)
Matching from a starting delimiter to an end delimiter (Regex/pattern matching)
我正在尝试匹配某个文本块。
我要匹配的文本格式是
<pevz:url>https://some.server.com/arbitraryFoo.jpeg</pevz:url>
其中只有 <pevz:url>
和 </pevz:url>
是已知的。
我天真的尝试是匹配
<pevz:url>*([0-9a-zA-Z:/._-])<\/pevz:url>
但这没有用。我正在使用 gedit 来匹配默认搜索和替换(没有 advanced-find
)。
如何匹配整个字符串?
此致,
乔·科克
你可以试试:
<pevz:url>(.*?)<\/pevz:url>
或
<pevz:url>([^>]+)<\/pevz:url>
我正在尝试匹配某个文本块。 我要匹配的文本格式是
<pevz:url>https://some.server.com/arbitraryFoo.jpeg</pevz:url>
其中只有 <pevz:url>
和 </pevz:url>
是已知的。
我天真的尝试是匹配
<pevz:url>*([0-9a-zA-Z:/._-])<\/pevz:url>
但这没有用。我正在使用 gedit 来匹配默认搜索和替换(没有 advanced-find
)。
如何匹配整个字符串?
此致, 乔·科克
你可以试试:
<pevz:url>(.*?)<\/pevz:url>
或
<pevz:url>([^>]+)<\/pevz:url>