The regular expression search replace in Notepad++ has some quirks. For example:
search for: "\r\n" or "\r" or "\n"
does not work.
How about adding a button next to the "Find what:" and "Replace with:" input fields that is enabled when "Regular expression" is checked which allows the user to select valid regular expressions. For example:
+--------------------------------------------+
|Any Character . |
|Beginning Of Line ^ |
|End of line $ |
|Character class [] |
|Negated character class [^] |
|Define a group () |
|Match left or right expression | |
---------------------------------------------+
|Preceding expression zero or more * |
|Preceding expression once or more + |
|Preceding expression zero or once ? |
|--------------------------------------------|
|Newline \n |
|Tab \t |
|Backspace \b |
|Carriage return \r |
|form feed \f |
|Hex digit \x |
|Escape meta character \ |
|--------------------------------------------|
|Alpha numeric character class [a-zA-Z0-9] |
+--------------------------------------------+
when the user select one of the above expressions the expression would be appended to the input field. Notepad++ could even append the unprintable character users currently have to select from the document being edited to represent newline and carriage return...
BTW: is the the right palace for suggestions?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
When you say "select valid regular expressions" do you mean each one has a button to paste it into your expression? A list of available expressions could be handy for those who aren't familiar with regular expressions, but I'm not sure how many people would want such a large window covering the text they're probably looking at as they build the expression.
What a occasional regular expression user like myself could use is a regular expression tester. I.e. a button on the search form to highlight all the text in the file that matches the expression I've typed. That would help me to create expressions faster by trial and error.
I guess this would be handy even for normal search strings.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I would like to second the suggestion to enable "Transform backslash expressions" mode in Notepad++. This is something that I find extremely useful and its the only thing keeping me on Scite and not allowing me to migrate to Notepad++.
Please add this feature.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I was suggesting a small button to the right edge of the input fields with text of "..." or an arrow "[>]" icon indicating more information about regular expressions that, when clicked it would popup/dropdown a list like the one I posted and when the user selects an item from the list Notepad++ would append the appropriate regular expression or character to the input field. In cases like searching for new line Notepad++ would append the new line character (0x0A?) not \n because according to a previous post I read "The searching engine comes from Scintilla (SciLexer.dll). Scintilla does not support searching for end of line, so Notepad++ does not also." This suggestion would help users new to regular expression syntax.
Alternatively the search/replace feature could modify the search and replace strings before they are sent to the lexer replacing things like \n with the 0x0A or whatever value is appropriate. This would hide the workarounds currently suggested for regular expression searches. The two ideas could also be combined to seamlessly support regular expression search and replace in Notepad++. This suggestion would allow users familiar with regular expressions seamless use of regular expressions in Notepad++.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi, you may want to look at the Find/Replace dialog of TextFX (Go to TextFX->TextFX Quick->Find/Replace or press Ctrl+R). It is very confortable for multy line replacements and have most of the optinons you want for regular expressions hints.
From that posting it sounds like my links don't work for some people if I follow them with a full stop. I didn't know that - they work ok for me in Firefox. I'll start adding a space after them.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The regular expression search replace in Notepad++ has some quirks. For example:
search for: "\r\n" or "\r" or "\n"
does not work.
How about adding a button next to the "Find what:" and "Replace with:" input fields that is enabled when "Regular expression" is checked which allows the user to select valid regular expressions. For example:
+--------------------------------------------+
|Any Character . |
|Beginning Of Line ^ |
|End of line $ |
|Character class [] |
|Negated character class [^] |
|Define a group () |
|Match left or right expression | |
---------------------------------------------+
|Preceding expression zero or more * |
|Preceding expression once or more + |
|Preceding expression zero or once ? |
|--------------------------------------------|
|Newline \n |
|Tab \t |
|Backspace \b |
|Carriage return \r |
|form feed \f |
|Hex digit \x |
|Escape meta character \ |
|--------------------------------------------|
|Alpha numeric character class [a-zA-Z0-9] |
+--------------------------------------------+
when the user select one of the above expressions the expression would be appended to the input field. Notepad++ could even append the unprintable character users currently have to select from the document being edited to represent newline and carriage return...
BTW: is the the right palace for suggestions?
When you say "select valid regular expressions" do you mean each one has a button to paste it into your expression? A list of available expressions could be handy for those who aren't familiar with regular expressions, but I'm not sure how many people would want such a large window covering the text they're probably looking at as they build the expression.
There's a regular expression FAQ at http://notepad-plus.sourceforge.net/uk/regExpList.php and a newline find and replace FAQ at http://notepad-plus.sourceforge.net/uk/newlineFindReplace-HOWTO.php. It would be nice to build these FAQS into a proper help system for the program. Checking a website for help isn't always convenient.
What a occasional regular expression user like myself could use is a regular expression tester. I.e. a button on the search form to highlight all the text in the file that matches the expression I've typed. That would help me to create expressions faster by trial and error.
I guess this would be handy even for normal search strings.
I would like to second the suggestion to enable "Transform backslash expressions" mode in Notepad++. This is something that I find extremely useful and its the only thing keeping me on Scite and not allowing me to migrate to Notepad++.
Please add this feature.
I second that suggestion.
I would also prefer longer textboxes, some of these expressions can develop into long strings.
I was suggesting a small button to the right edge of the input fields with text of "..." or an arrow "[>]" icon indicating more information about regular expressions that, when clicked it would popup/dropdown a list like the one I posted and when the user selects an item from the list Notepad++ would append the appropriate regular expression or character to the input field. In cases like searching for new line Notepad++ would append the new line character (0x0A?) not \n because according to a previous post I read "The searching engine comes from Scintilla (SciLexer.dll). Scintilla does not support searching for end of line, so Notepad++ does not also." This suggestion would help users new to regular expression syntax.
Alternatively the search/replace feature could modify the search and replace strings before they are sent to the lexer replacing things like \n with the 0x0A or whatever value is appropriate. This would hide the workarounds currently suggested for regular expression searches. The two ideas could also be combined to seamlessly support regular expression search and replace in Notepad++. This suggestion would allow users familiar with regular expressions seamless use of regular expressions in Notepad++.
Hi, you may want to look at the Find/Replace dialog of TextFX (Go to TextFX->TextFX Quick->Find/Replace or press Ctrl+R). It is very confortable for multy line replacements and have most of the optinons you want for regular expressions hints.
About the "\r\n" problem - I have logged the following feature request and hope that the N++ developer(s) will implemet it: http://sourceforge.net/tracker/index.php?func=detail&aid=1645159&group_id=95717&atid=612385 (there are so many feature request though, so I'm not sure they will have the time to pay attention to it).
@pshute: I couldn't find this HOWTO http://notepad-plus.sourceforge.net/uk/newlineFindReplace-HOWTO.php , I'll be grateful if you can give a working link to it, please.
Regards,
Rocky
@pshute: I found the answer of my problem with the link in other your post http://sourceforge.net/forum/message.php?msg_id=4157359 , thanks!
From that posting it sounds like my links don't work for some people if I follow them with a full stop. I didn't know that - they work ok for me in Firefox. I'll start adding a space after them.