Thread: Regex examples
View Single Post
Old 09-03-2015, 02:12 AM   #478
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,741
Karma: 24031403
Join Date: Dec 2010
Device: Kindle PW2
There are probably more elegant solutions, but the following expression should do the trick assuming that the text before and after the page number is also wrapped in paragraph tags:

Find:<p([^>]*)>(.*?)</p>\s*<p[^>]*>\d+</p>\s*<p[^>]*>(.*?)</p>

Replace:<p\1>\2 \3</p>
Doitsu is offline   Reply With Quote