AS3 regex - how to match 2 consecutive matches multiple times?
I have the following regex, which will match all the <br>
and <br />
tags in a string:
/<br[\s|\/]*>/gi
I actually want to match every set of two consecutive tags, with valid matches being:
<br><br>
<br/><br>
<br><br/>
<br/><br/>
(and all variations with a space before the slash)
Obviously I can just double up the expressio开发者_JAVA百科n to /<br[\s|\/]*><br[\s|\/]*>/gi
, but is there a shorter way of taking the first expression and saying "this, but twice"?
Try this one:
/(<br[\s|\/]*>){2}/gi
精彩评论