Find: Match whole word and Regular expression simultaneously
Posted: Fri Jul 31, 2009 10:17 pm
Is it just me, or has there been a change from Textpad 5.1 to 5.2? In the Find (or Replace) dialog box, "Match whole words" and "Regular expression" are now mutually exclusive. Has it always been like that?
What I miss is to be able to select both "Match whole word" and "Regular expression". The effect I want is simply that TextPad internally puts "\<" before and "\>" after the expression if I select both "Match whole word" and "Regular expression". It is a pain having to type "\<" and "\>" in the search expression if I could just tick a checkbox to get the effect.
Very often I start a Replace by selecting a word and then choosing Edit | Replace, so that I start with the selected text in the "Find what" field. Then I often want to replace the text using a regular expression including "&", e.g. to add something to the function name I am searching for. It is so much easier to just press Alt+W to search for whole words instead of having to type "\<" and "\>" in the "Find what" field for every function name I want to add something to. And it is very important to search for whole words only when searching for function names, as the search should not match only parts of function names.
So my suggestion is to allow for both "Match whole word" and "Regular expression" at the same time, and the internal interpretation should be to simply add "\<" before and "\>" after the "Find what" expression. But only internally - the "\<" and "\>" should not show up in the "Find what" field.
It would make life easier for me, and I guess that's the whole purpose of TextPad - to make life easier for people working with text files.
It is a clear enhancement that doesn't change the way TextPad works now, so it will not be in the way of anyone, I think.
What I miss is to be able to select both "Match whole word" and "Regular expression". The effect I want is simply that TextPad internally puts "\<" before and "\>" after the expression if I select both "Match whole word" and "Regular expression". It is a pain having to type "\<" and "\>" in the search expression if I could just tick a checkbox to get the effect.
Very often I start a Replace by selecting a word and then choosing Edit | Replace, so that I start with the selected text in the "Find what" field. Then I often want to replace the text using a regular expression including "&", e.g. to add something to the function name I am searching for. It is so much easier to just press Alt+W to search for whole words instead of having to type "\<" and "\>" in the "Find what" field for every function name I want to add something to. And it is very important to search for whole words only when searching for function names, as the search should not match only parts of function names.
So my suggestion is to allow for both "Match whole word" and "Regular expression" at the same time, and the internal interpretation should be to simply add "\<" before and "\>" after the "Find what" expression. But only internally - the "\<" and "\>" should not show up in the "Find what" field.
It would make life easier for me, and I guess that's the whole purpose of TextPad - to make life easier for people working with text files.
It is a clear enhancement that doesn't change the way TextPad works now, so it will not be in the way of anyone, I think.