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.
我在 Wordpess 中有数据页,在数据中,我想检测 3 个 <br> 或 3 个输入字符。 要检测 3 个或更多新行字符, 我有:/(^[\rn]*|[\r\n]+)[\s\t]*[\r\n]{3,}+/ 我需要添加和选项来检测 3 个新行字符或 3 个 <br />。如何实现?谢谢
/(^[\rn]*|[\r\n]+)[\s\t]*[\r\n]{3,}+/
这个正则表达式应该这样做:
/(?:(?=[\r\n])\r?\n?|<br[^>]+>){3,}/
解释:
\r
\n
\r\n
<br>
<br />
<br style="clear:both">