View Single Post
Old 02-23-2012, 02:37 PM   #1
cybmole
Wizard
cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.
 
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
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.
cybmole is offline   Reply With Quote