Quote:
Originally Posted by automa
Is there a way you can apply heading 1 on all of those paragraphs that begins with the word Chapter?
|
Regex is your friend here. You should learn the basics of it if you want to start automating stuff to your advantage.
Please don't use this blindly without having good backups (and I'm sure someone will find a more effective/safe way--that's the beauty of regex
) but something like:
Code:
<p([^>]+)>(.*?)Chapter(.*?)</p>
replaced with:
Code:
<h1\1>\2Chapter\3</h1>
might work. It will retain any ids/classes the paragraph might have, as well as any elements that may be in front of/behind "Chapter." Without seeing the code in question, it's always a bit of a crapshoot. Make sure you're in regex S&R mode and have the "DotAll" option checked and the "Minimum Match" option unchecked.
Even so, any legitimate paragraph with the word "Chapter" in it is going to get caught up as well.
If there's a question of case (chapter, Chapter, CHAPTER), simply tell regex to ignore case by preceding the expression with (?i):
Code:
(?i)<p([^>]+)>(.*?)Chapter(.*?)</p>