OK, I've done a quick test on one page, and this works. But before attempting to use this solution, BACK UP YOUR SITE.
You need to use the following regular expression (regex) in the Find field:
See corrected version in next post
In the Replace field:
Select the "Use regular expression" checkbox.
Test it on a couple of pages. Then take a deep breath, and do it on the entire site.
Thanks, David, but I'm not getting it to work. All that happens when I click Replace is that the code between and including the title and h1 tags is highlighted. Nothing gets changed.
I see that you have "This is the Title I want" next to "Find in Current Document". Should I be seeing something there in mine, because I don't. Does that appear after the replace is complete?
Is there a way to tell it to place only the first h1 tag into the title?
I am really motivated now to learn regex!
Yes. Just use the following regex instead of the previous one:
The Replace field is the same.
The question mark makes the [\S\s]+ a lazy search, stopping at the first <h1> rather than doing a greedy search which finds the last <h1> in the page.
Learning regex is tough, but it can be really rewarding. I wish I knew them better.
Thanks for your posts in this thread. I was able to get your Regex code to work, too, but I need a slightly different code change. I need to change the title tag sitewide, but instead of matching the h1 tag, it has to match an id tag.
<div id="detailTitle" class="detailText">
Image Title </div>
What's the required tweak to your code?