Hi Ralph,

Find:

(?s)XXXXXXXXXX(.+?)XXXXXXXXXX

Replace:

YYYYYYYYY\1YYYYYYYYY

Some explanation:

(?s) means allow the dot (which is the regular expression wildcard 
character) to match at new lines.
(.+?) means capture one or more characters non-greedily.
\1 is the result of that capture.

For anything touching regular expression patterns you should check the 
excellent BBEdit's menu Help >  BBEdit Help > Grep Reference.

HTH,

Jean Jourdain


On Sunday, November 7, 2021 at 4:18:07 PM UTC+1 [email protected] wrote:

> Greetings all.  First time post.  
>
> I need to find and replace a consistent block of HTML that wraps around a 
> variable string of text, like this:
>
> XXXXXXXXXX
> adiuhkjashfutrhat
> XXXXXXXXXX
>
> and
>
> XXXXXXXXXX
> hjsutqpds
> XXXXXXXXXX
>
> etc.
>
> I need to replace XXXXXXXXXX with YYYYYYYYY
>
> resulting in this 
>
> YYYYYYYYYY
> adiuhkjashfutrhat
> YYYYYYYYYY
>
> and
>
> YYYYYYYYYY
> hjsutqpds
> YYYYYYYYYY
>
>
> Is there a GREP term or switch that will grab a string of VARIABLE text 
> and carry it over to a replace across dozens of instances?
>
> Thanks all.  
>
> Hawk in Macon
>
>

-- 
This is the BBEdit Talk public discussion group. If you have a feature request 
or need technical support, please email "[email protected]" rather than 
posting here. Follow @bbedit on Twitter: <https://twitter.com/bbedit>
--- 
You received this message because you are subscribed to the Google Groups 
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/407878b5-6d33-465b-b511-b4c4c9d040afn%40googlegroups.com.

Reply via email to