Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
可能重复: 正则表达式匹配打开的标签,XHTML 自包含标签除外
<a href="http://abc.com/abc.htm" style="color:#005F9A;">I need it</a>
我怎样才能得到“我需要它”的句子?我想使用正则表达式...
这是您可以用来提取所需内容的正则表达式模式:
(?<=\<a\shref=.*?\>).*?(?=\<\/a\>)