Search in "Find in files" result
Post here questions and problems related to editing and publishing DITA content.
-
- Posts: 2
- Joined: Tue Mar 23, 2021 4:33 pm
Search in "Find in files" result
Hello,
I'm not comfortable with xml, other than just writing in author mode so please keep it simple
I need to exchange the word "dialog" to "dialog box" in multiple places in my bookmap. However, I also have entries that are already correct, i.e. "dialog box". If I do a find and replace all, the outcome in some cases will be "dialog box box". So far, I have gone from there and replaced "box box" with just "box".
When doing a search and replace in files, a tab with the findings appear (all my "dialog" hits), and in this list, files can be removed (those already correct "dialog box"). I was hoping I could start from this list (the one with "dialog box" removed), and replace only the entries that are left. Is there a way to do that?
Thanks in advance!
I'm not comfortable with xml, other than just writing in author mode so please keep it simple

I need to exchange the word "dialog" to "dialog box" in multiple places in my bookmap. However, I also have entries that are already correct, i.e. "dialog box". If I do a find and replace all, the outcome in some cases will be "dialog box box". So far, I have gone from there and replaced "box box" with just "box".
When doing a search and replace in files, a tab with the findings appear (all my "dialog" hits), and in this list, files can be removed (those already correct "dialog box"). I was hoping I could start from this list (the one with "dialog box" removed), and replace only the entries that are left. Is there a way to do that?
Thanks in advance!
-
- Posts: 2879
- Joined: Tue May 17, 2005 4:01 pm
Re: Search in "Find in files" result
Hello,
The preview of the Replace in Files allows you to uncheck some of the files from the list. So, if the file granularity is fine, than sure, it can be done that way. But note that if you have files where both "dialog" and "dialog box" appear, you can't fix it.
It is actually possible to search for both "dialog" and "dialog box" whichever occurs (largest match) with the help of a regular expression.
Find: dialog( box)*
Replace with: dialog box
[x] Regular expression
( box)* means the space and box are optional.
This ensures that "dialog box" and "dialog" are replaced with "dialog box".
It's also possible to search for "dialog not followed by box". It can be done like this:
Find: dialog(?! box)
Replace with: dialog box
[x] Regular expression
Where (?! box) means not followed by space and box.
So, this replaces "dialog not followed by box" with "dialog box".
Regards,
Adrian
The preview of the Replace in Files allows you to uncheck some of the files from the list. So, if the file granularity is fine, than sure, it can be done that way. But note that if you have files where both "dialog" and "dialog box" appear, you can't fix it.
It is actually possible to search for both "dialog" and "dialog box" whichever occurs (largest match) with the help of a regular expression.
Find: dialog( box)*
Replace with: dialog box
[x] Regular expression
( box)* means the space and box are optional.
This ensures that "dialog box" and "dialog" are replaced with "dialog box".
It's also possible to search for "dialog not followed by box". It can be done like this:
Find: dialog(?! box)
Replace with: dialog box
[x] Regular expression
Where (?! box) means not followed by space and box.
So, this replaces "dialog not followed by box" with "dialog box".
Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
-
- Posts: 922
- Joined: Thu May 02, 2019 2:32 pm
Re: Search in "Find in files" result
Post by chrispitude »
Hi JDL_CYT,
Here is a webpage where you can play around with regular expressions. I put Adrian's second example in the fields for you.
https://regex101.com/r/YAHVVF/1
- Chris
Here is a webpage where you can play around with regular expressions. I put Adrian's second example in the fields for you.
https://regex101.com/r/YAHVVF/1
- Chris
Return to “DITA (Editing and Publishing DITA Content)”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service