Temporary commenting and uncommenting ulinks

<oXygen/> general issues.
honyk
Posts: 168
Joined: Wed Apr 29, 2009 4:55 pm

Temporary commenting and uncommenting ulinks

Post by honyk » Tue Aug 06, 2013 11:24 am

Dear All,

in my source there are lots of <ulink src="http:/server.com">label</ulink> fragments.

I'd like to temporarily disable all the links in my source, but to keep the label itself there:
<!--ulink src="http:/server.com"-->label<!--/ulink-->

Can anybody suggest the exact regular expression for replacing all such occurrences via the Oxygen Search/Replace dialog?

Thanks, Jan

adrian
Posts: 2599
Joined: Tue May 17, 2005 4:01 pm

Re: Temporary commenting and uncommenting ulinks

Post by adrian » Tue Aug 06, 2013 5:23 pm

Hello Jan,

You can use the following expressions and options in the Oxygen Find/Replace dialog:
Text to find:

Code: Select all

<(ulink\s+src=[^>]+)>([^<]*?)</ulink>
Replace with:

Code: Select all

<!--$1-->$2<!--/ulink-->
Options: Regular expression

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

honyk
Posts: 168
Joined: Wed Apr 29, 2009 4:55 pm

Re: Temporary commenting and uncommenting ulinks

Post by honyk » Wed Aug 07, 2013 3:18 pm

Adrian,

thanks a lot for showing the way.

Finally I use a slightly modified variant:

Code: Select all

<(ulink[^>]+)>([^<]*?)<(/ulink)>
Replaced with:

Code: Select all

<!--$1-->$2<!--$3-->
and the following code for the reverse procedure:

Code: Select all

<!--(ulink[^>]+)-->([^<]*?)<!--(/ulink)-->
Replaced with:

Code: Select all

<$1>$2<$3>
HTH to anybody in the future,

Jan

Post Reply