Quote:
Originally Posted by roger64
Search and replace excluding the headers
I am trying to insert old nums in an ePub. For this I need to wrap a span around these characters like:
Code:
(\d+)
<span class="smcp" >\1</span>
However I need to exclude the headers, if not I have to correct all of them...
Could a function do it?
|
If this is just numbers in paragraphs, you could do:
Code:
(<p>.*?)(\d+)(.*?</p>)
With the replace:
Code:
\1<span class="smcp" >\2</span>\3
That does have a problem if a paragraph has more than one number in the paragraph. The following might be better, but, it still has issues:
Code:
(<p>.*?[^\>\d])(\d+)(.*?</p>)