Can placeholders be used in Notepad++ search&replace dialog? I need to replace all entities in a bunch of 50+ XML DocBook files. I need to find all text between "&" and ";" using a placeholder, something like "&*;" then replace all coincidences by any mark-defined convention, e.g. E*E, but leaving the text between unaffected. How can this be in Notepad++ S&R dialog?
Thanks in advance. God bless you.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Greetings
Can placeholders be used in Notepad++ search&replace dialog? I need to replace all entities in a bunch of 50+ XML DocBook files. I need to find all text between "&" and ";" using a placeholder, something like "&*;" then replace all coincidences by any mark-defined convention, e.g. E*E, but leaving the text between unaffected. How can this be in Notepad++ S&R dialog?
Thanks in advance. God bless you.
As long as each occurrence is on a single line, I guess you can use regular expression mode in the Find/Replace dialogs. I prefer to use CTRL+R.
You have to search for:
&([^;]+);
Replace this by:
E\1E
Check regex mode.
This will search for the placeholders including the text in-between and replace it by E + the text in-between + E.
\1_______ means: the first () grouped expression in the find field
[^;]_____ means: any character not being a ;
+________ means: at least one, or more occurences of the preceding expression
Look for other threads about regular expressions to get more familiar with the subject.
Thanks a lot. It went just as expected. God bless you.