I believe the following find/replace should work. I took your description 
to mean that the contents inside h1 should be replaced with the contents of 
the title1 tag and vice versa. This achieved that in brief testing.

Search for:
(?s)<(title1)>(.+?)</\1>(.+?)<h1>(.+?)</h1>

Replace with:
<\1>\4</\1>\3<h1>\2</h1>

The (?s) allows the . to match across new lines.

-Kendall


On Tuesday, May 22, 2012 5:49:06 PM UTC-4, Be wrote:
>
> Is this even possible using Grep?
>
> I have a variable string towards the top of each document that looks like:
>
> <title1>Variable string with unknown number of words, digits, spaces and 
> returns</title1>
>
> I have another variable string a little further down in each document that 
> looks like:
>
> <h1>Variable string with same unknowns as the first variable string</h1>
>
> I want to replace the 2nd string with the first string.
>
> Any ideas would be appreciated. Thanks!
>
>
>

-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at
<http://groups.google.com/group/bbedit?hl=en>
If you have a feature request or would like to report a problem, 
please email "supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>

Reply via email to