Inserting whitespace special characters
Having trouble installing Oxygen? Got a bug to report? Post it all here.
-
- Posts: 33
- Joined: Wed Oct 04, 2006 6:25 pm
Inserting whitespace special characters
Hi,
In Oxygen I can search for whitespace (newlines, tabs, etc.) using regular expressions, but if I want to replace what I find with some of those special characters I can't use the regular expression and I have to use the character itself.
Imagine I want to replace a newline with a tab, I search for
and replace it with
I won't work. I need to use (just in case the output is not identical to my input, between the two variables below there's a tab, not three spaces).
Is there any way I can use the former? It's a bit annoying having to copy the tab somewhere and paste it in the search dialog (as it can't be typed there directly).
Thanks a lot!
Cheers, Manuel
In Oxygen I can search for whitespace (newlines, tabs, etc.) using regular expressions, but if I want to replace what I find with some of those special characters I can't use the regular expression and I have to use the character itself.
Imagine I want to replace a newline with a tab, I search for
Code: Select all
^(.+)\n(.+\n)
Code: Select all
$1\t$2
Code: Select all
$1 $2
Thanks a lot!
Cheers, Manuel
-
- Posts: 2879
- Joined: Tue May 17, 2005 4:01 pm
Re: Inserting whitespace special characters
Hello,
If you right click in either the find or the replace text areas from the Find/Replace dialog you will get a contextual menu which has as its last two actions: 'Insert newline' and 'Insert tab'
'Insert newline' also has a shortcut: Ctrl+Enter
Let me know if I misunderstood and that's not what you were looking for
Regards,
Adrian
If you right click in either the find or the replace text areas from the Find/Replace dialog you will get a contextual menu which has as its last two actions: 'Insert newline' and 'Insert tab'
'Insert newline' also has a shortcut: Ctrl+Enter
Let me know if I misunderstood and that's not what you were looking for
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: 33
- Joined: Wed Oct 04, 2006 6:25 pm
Re: Inserting whitespace special characters
Hi Adrian,
Thanks a lot for your reply!
I think you understood. While your answer is not what I was after, it does help me to perform my searches and replaces, as I don't need to copy-paste anymore.
However, it would still be handy to be able (to choose) to type the regex instead of entering the character itself, it would make expressions more compact, concise and clear. But I guess this way of doing it has to do with XML syntax perhaps...
Actually out of my ignorance I wonder why in the field field it's possible to use \n or \t but not in the replace field.
Cheers and thanks again, Manuel
Thanks a lot for your reply!
I think you understood. While your answer is not what I was after, it does help me to perform my searches and replaces, as I don't need to copy-paste anymore.
However, it would still be handy to be able (to choose) to type the regex instead of entering the character itself, it would make expressions more compact, concise and clear. But I guess this way of doing it has to do with XML syntax perhaps...
Actually out of my ignorance I wonder why in the field field it's possible to use \n or \t but not in the replace field.
Cheers and thanks again, Manuel
-
- Posts: 2879
- Joined: Tue May 17, 2005 4:01 pm
Re: Inserting whitespace special characters
Hi,
The patterns in the replace field are a limitation of the Java regular expression engine. By default it only supports groups in the replace string.
But now that you mention it '\t' in the replace field should have worked.
\t, \n, \r, \uXXXX, \xXX, \0->\9 have all been specifically implemented since the release of Oxygen 10.3.
What version of Oxygen are you using?
Regards,
Adrian
The patterns in the replace field are a limitation of the Java regular expression engine. By default it only supports groups in the replace string.
But now that you mention it '\t' in the replace field should have worked.
\t, \n, \r, \uXXXX, \xXX, \0->\9 have all been specifically implemented since the release of Oxygen 10.3.
What version of Oxygen are you using?
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: 33
- Joined: Wed Oct 04, 2006 6:25 pm
Re: Inserting whitespace special characters
Yep, my version is 10.0. That might be why.
If I use \t all I get is a t (an escaped t?).
I'll install the newest and see.
Thank you very much, Adrian, you have been very helpful!
Cheers, Manuel
If I use \t all I get is a t (an escaped t?).
I'll install the newest and see.
Thank you very much, Adrian, you have been very helpful!
Cheers, Manuel
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