I wrote a regular expression trying to match some html code but I can't quite it to work. I'm having a problem with the part after "wp-caption".
class=(["\'])(?:[\w\s])*?wp-caption[\s\1]
The code I want to match:
class="wp-caption"
class='wp-caption'
class="wp-caption foo"
class="foo wp-caption"
I match the first three results but not the fourth. I don't think the \1 is working. Any thoughts?
BTdubs I've been using http://regexpal.com/ for testing purposes.