regex puzzle: finding paragraph before...
due to a badly formatted book I was trying to constuct a regex which would find any <p......./p> section which occured immediately beofre a <div, in order to then tweak that found chunk.
but I could not do it.
a find expression like <p class "whatever">(.*)</p>?\s*<div is too greedy - it grabbed a whole load of paragraphs
i.e. from
<p para 1...
<p para 2..
...
<p para n..
< div....
the above regex grabs n paragraphs , is there a way to grab only the nth one , and replace it's CSS class
PS I am still using 0.42 regex
or could I use a .p+div class in CSS ?
Last edited by cybmole; 02-23-2012 at 02:39 PM.
|