Regex tester
Pattern
Input
this <span>pattern</span> captures all <span>outermost <span>(not nested)</span> balanced span tags</span>, so if we leave a span tag open, <span>it won
Options
Replacement
Click the context tab to see replacements.
2 matches found in about 7 milliseconds.
IndexPositionMatched String$1$2$3${open}${close}
05<span>pattern</span><span>pattern</span><span>pattern</span>empty stringpattern
139<span>outermost <span>(not nested)</span> balanced span tags</span><span>outermost <span>(not nested)</span> balanced span tags</span><span>(not nested)
2 captures
  1. <span>outermost
  2. <span>(not nested)
balanced span tags</span>
2 captures
  1. </span>
  2. balanced span tags</span>
empty stringoutermost <span>(not nested)</span> balanced span tags
2 captures
  1. (not nested)
  2. outermost <span>(not nested)</span> balanced span tags
this <span>pattern</span> captures all <span>outermost <span>(not nested)</span> balanced span tags</span>, so if we leave a span tag open, <span>it won
  1. this
  2. <span>pattern</span>
  3. <span>pattern
  4. </span>
  5. pattern
  6. captures all
  7. <span>outermost <span>(not nested)</span> balanced span tags</span>
  8. <span>(not nested)
  9. balanced span tags</span>
  10. outermost <span>(not nested)</span> balanced span tags
  11. , so if we leave a span tag open, <span>it won