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.
我如何使用正则表达式来获得以下内容。标签中的内容可能是字母、数字和元字符。
输入字符串:"<p>Hi </p><p>there</p>"
"<p>Hi </p><p>there</p>"
预期输出:"Hi<p>there</p>.
"Hi<p>there</p>.
在进一步的规范到来之前,请使用以下内容:
<p>(.)*?</p>并使用第一个(也是唯一的)组 (.)*?
<p>(.)*?</p>
这个匹配<p> Hi </p>然后使用 \1 来引用 ' Hi '
<p> Hi </p>