Page 1 of 1

Temporary commenting and uncommenting ulinks

Posted: Tue Aug 06, 2013 11:24 am
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

Re: Temporary commenting and uncommenting ulinks

Posted: Tue Aug 06, 2013 5:23 pm
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

Re: Temporary commenting and uncommenting ulinks

Posted: Wed Aug 07, 2013 3:18 pm
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