Searching for PIs that do not have a particular word in the comment
Post here questions and problems related to editing and publishing DITA content.
-
- Posts: 4
- Joined: Thu Mar 22, 2018 8:32 pm
Searching for PIs that do not have a particular word in the comment
Post by skeptamistic »
How do I search for processing instructions that do not have a specified word in the PI comment="" ?
Suppose the word is future.
In the find dialog in oXygen, when I activate regex and Enable XML search options > PIs, the following regex (unfortunately) matches a PI that includes comment="future: purpose-action":
I believe I can be better at regex. 
Suppose the word is future.
In the find dialog in oXygen, when I activate regex and Enable XML search options > PIs, the following regex (unfortunately) matches a PI that includes comment="future: purpose-action":
Code: Select all
(?!.*future).*

-
- Posts: 2879
- Joined: Tue May 17, 2005 4:01 pm
Re: Searching for PIs that do not have a particular word in the comment
Hello,
I'm afraid you can't use Enable XML search options > PIs for this situation. The problem is you need to match an entire PI that doesn't have "future" in it, not just parts of it. So for this you would need ^ (region beginning) and $ (region end). However, Oxygen interprets these as line start and line end, so they can't be used with XML search options (they won't provide a match).
Without "Enable XML search options" try the following regular expression (this matches entire PIs):
Regards,
Adrian
I'm afraid you can't use Enable XML search options > PIs for this situation. The problem is you need to match an entire PI that doesn't have "future" in it, not just parts of it. So for this you would need ^ (region beginning) and $ (region end). However, Oxygen interprets these as line start and line end, so they can't be used with XML search options (they won't provide a match).
Without "Enable XML search options" try the following regular expression (this matches entire PIs):
Code: Select all
(?<=<\?)((?!future).)*?(?=\?>)
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: 4
- Joined: Thu Mar 22, 2018 8:32 pm
Re: Searching for PIs that do not have a particular word in the comment
Post by skeptamistic »
@Adrian,
Thanks!
Best regards,
Thanks!
Best regards,
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