Find/replace newline

Having trouble installing <oXygen/>? Got a bug to report? Post it all here.
MelkorX
Posts: 8

Find/replace newline

Thu Jun 15, 2017 2:46 am

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: 5217

Re: Find/replace newline

Thu Jun 15, 2017 9:33 am

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: 8

Re: Find/replace newline

Thu Jun 22, 2017 11:55 pm

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

Return to “Common Problems”

Who is online

Users browsing this forum: No registered users and 1 guest