Temporary commenting and uncommenting ulinks

Oxygen general issues.
honyk
Posts: 176
Joined: Wed Apr 29, 2009 4:55 pm

Temporary commenting and uncommenting ulinks

Post by honyk »

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: 2855
Joined: Tue May 17, 2005 4:01 pm

Re: Temporary commenting and uncommenting ulinks

Post by adrian »

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: 176
Joined: Wed Apr 29, 2009 4:55 pm

Re: Temporary commenting and uncommenting ulinks

Post by honyk »

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