Find/replace newline

Having trouble installing Oxygen? Got a bug to report? Post it all here.
MelkorX
Posts: 10
Joined: Wed Feb 03, 2016 1:36 am

Find/replace newline

Post by MelkorX »

I am trying to remove extra spaces at the beginning and end of <codeblock> elements in DITA files. For example:

<codeblock>
codeExample ce = new codeExample();
ce.someFunction();
</codeblock>

should be

<codeblock>codeExample ce = new codeExample();
ce.someFunction();</codeblock>

I'm having trouble accomplishing this with the Find/Replace in Files dialog. Any tips?
Radu
Posts: 9470
Joined: Fri Jul 09, 2004 5:18 pm

Re: Find/replace newline

Post by Radu »

Hi,

With the "Regular Expressions" checkbox checked you can search for something like <codeblock>[\n\r\s]+ and replace with something like <codeblock>.
Our "Replace All" functionality allows you to preview the changes before applying them.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
MelkorX
Posts: 10
Joined: Wed Feb 03, 2016 1:36 am

Re: Find/replace newline

Post by MelkorX »

Thanks Radu. I had to add \t as well to the regular expression, and then it worked.
Post Reply