Re: [oXygen-user] Find/Replace in Files: unable to find pretty-printed word combinations

Hi, We added the support for spanning multiple lines with a regular expression in Find/Replace in Files in Oxygen 14.0. So if you use an older version of Oxygen the regular expression that contains (\s+) will find only the matches that span one line, that is it will not match the end-of-line character. You did not specify your Oxygen version but I think it is older than 14.0. I checked in Oxygen 13.2 and this feature was not present, it is a new feature of version 14.0. If you do not use version 14.0 please upgrade. Regards, Sorin Yves Barbion wrote:
Hi Sorin
I have checked all the options in the Find/Replace in Files dialog box and I have also included a screen shot in the attached ZIP file.
Thank you in advance for your assistance.
Yves Barbion www.scripto.nu
On 31-07-2012 12:47, Sorin Ristache wrote:
Hi,
Please check all the values in the Find/Replace in Files dialog box: scope should be "Current DITA map hierarchy", file filter should be *.dita (or *.xml), etc. If all values are correct in the dialog box please send a sample DITA topic file that should be found by the find action but is not found and also specify the search string that you used.
Regards, Sorin
Yves Barbion wrote:
Hi Sorin
Thank you for your prompt reply, but I'm afraid we're not quite there yet. When I search for "time(\s+)zone" (without the quotes), oXygen does not find it. A similar example is this:
<p status="changed">The body of the <keyword
conref="_conref_library.xml#topic_qjt_sdx_1f/keyword_wms_s2x_1f"/> consists of the following zones:</p>
When I search for "consists of(\s+)the following" or "consists(\s+)of(\s+)the(\s+)following" with the Regular Expression option selected, oXygen will only find the occurrences where there is only a single space between the words.
Any other ideas?
Thanks.
Yves

Hi Sorin Yes, it works in oXygen 14! Thank you very much for your help! The only problem I have now is how I can explain this to my (DITA) students and how I can convince them to use regular expressions. Most of them are new to DITA and XML. Also, when you search for some text, you don't know where the end-of-line character is, so to find the topic in the example below, you may have to replace every space with (\s+) in the Find/Replace in Files dialog: Find: consists(\s+)of(\s+)the(\s+)following(\s+)zones if the topic contains: <p status="changed">The body of the <keyword conref="_conref_library.xml#** topic_qjt_sdx_1f/keyword_wms_**s2x_1f"/> consists of the following zones:</p> Kind regards -- Yves Barbion www.scripto.nu

Yves makes some good points here. It would be really nice to have a check-box option that ignores white space in the search, without the need to learn regular expressions. Perhaps that would be implemented internally by replacing spaces with \s+. Yves, for your immediate issue, what about providing an example search along with a link to more info about regular expressions, to your team? In my environment, I’d create a wiki page about this, and start collecting examples from people. This is how we approach encouraging the use of the Xpath field … I don’t expect all my users to know Xpath, so I tell them how to do a search like //figure/title to get a list of figure titles, and point out they can do the same for sections or anything with a title (we use DocBook). Maybe you could develop a series of regular expression examples to lead your students down the shining path of regex greatness. ☺ --Aaron DaMommio From: oxygen-user-bounces@oxygenxml.com [mailto:oxygen-user-bounces@oxygenxml.com] On Behalf Of Yves Barbion Sent: Tuesday, July 31, 2012 11:39 AM To: Sorin Ristache Cc: oXygen-user@oxygenxml.com Subject: Re: [oXygen-user] Find/Replace in Files: unable to find pretty-printed word combinations Hi Sorin Yes, it works in oXygen 14! Thank you very much for your help! The only problem I have now is how I can explain this to my (DITA) students and how I can convince them to use regular expressions. Most of them are new to DITA and XML. Also, when you search for some text, you don't know where the end-of-line character is, so to find the topic in the example below, you may have to replace every space with (\s+) in the Find/Replace in Files dialog: Find: consists(\s+)of(\s+)the(\s+)following(\s+)zones if the topic contains: <p status="changed">The body of the <keyword conref="_conref_library.xml#topic_qjt_sdx_1f/keyword_wms_s2x_1f"/> consists of the following zones:</p> Kind regards -- Yves Barbion www.scripto.nu<http://www.scripto.nu>

Hi, That is exactly the subject of an enhancement of the Find/Replace in Files dialog which is planned for one of the 14.x versions of Oxygen. The new checkbox will be called probably "Treat consecutive whitespaces as one". Regards, Sorin DaMommio, Aaron D (Aaron) wrote:
Yves makes some good points here. It would be really nice to have a check-box option that ignores white space in the search, without the need to learn regular expressions. Perhaps that would be implemented internally by replacing spaces with \s+.

Hi Aaron Great suggestion to provide example searches. I see that the Find/Replace in Files dialog remembers my previous searches, so that's great because I can include my examples there. And yes, I'll write a DITA topic about this. @Sorin: good to see that "Treat consecutive whitespaces as one" will be in one of the 14.x releases. Cheers -- Yves Barbion www.scripto.nu
participants (3)
-
DaMommio, Aaron D (Aaron)
-
Sorin Ristache
-
Yves Barbion