On 18 Jun 2011, at 1:29 AM, mackdoyle wrote:

> I need to take the Brand node and copy and paste it. Then change the
> new brand node to mpn.
> 
> So I thought I could replace "<g:brand><![CDATA[SwissGear]]></
> g:brand>" with <g:brand><![CDATA[SwissGear]]></g:brand><g:mpn><!
> [CDATA[SwissGear]]></g:brand>
> 
> However the string SwissGear needs to be a wild card since it is
> different for each record.

Try search:
<g:brand><!\[CDATA\[([^]]+)]]></g:brand>

and replace:
<g:brand><![CDATA[\1]]></g:brand><g:mpn><![CDATA[\1]]></g:brand>

I haven't tested this rigorously, but it works for me for simple CDATA, 
including multi-line. It doesn't handle whitespace anywhere but in the CDATA. 
Also, I take the contents of the CDATA to be anything up to a "]", even if you 
mean the "]" to be part of the CDATA, because I'm too lazy to look up how that 
character is to be handled.

        — F

-- 
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
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 "[email protected]" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>

Reply via email to