What would be the regex that will catch html element that has class 'slide'? So it will catch:
<div class="slide">
<span class="slide foo">
<img class="foo slide bar">
It shouldn't catch:
<div id="slide">
<div class="slide2">
What would be the regex that will catch html element that has class 'slide'? So it will catch:
<div class="slide">
<span class="slide foo">
<img class="foo slide bar">
It shouldn't catch:
<div id="slide">
<div class="slide2">
I agree that you should avoid parsing HTML with regex... But, if you are stuck in a spot where you have to do it, this should work:
/class="(.*[ ]+)*(slide)([ ]+.*)*"/
Inside the class tag, it is looking for zero or more instances of characters with at least one space before and after the word slide