- July 6, 2010 at 3:06 pm #8717
1. Open the Find dialog, tick the “Regular Expressions” checkbox, close the dialog.
2. Select any text that contains characters that play special role in regular expressions (for example, perl variables look like $something), press Ctrl+F3.
3. The selected text will be treated as a regular expression, not as text itself, and therefore even the selected text will not be found.
I think, in such situation EmEditor should just internally escape all the meta-characters that happened to be present in the selected block.July 6, 2010 at 5:20 pm #8719Yutaka EmuraKeymaster
Thanks for your comments. Some people don’t want to change the text at all, so this needs to be optional. I might think about that in future versions.July 6, 2010 at 6:40 pm #8720
Well, an option would be helpful, but I’d prefer the following implementation:
a) if user presses Ctrl+F3/Ctrl+Shift+F3, then EmEditor search the selected text exactly what it is, i.e. escape if necessary, no matter what options are set;
b) if user presses Ctrl+F to open the Find dialog, then the text automatically inserted there either as is, or escaped – that’s where the option comes in.
It’s extremely hard for me to believe that there is at least one user who deliberately selects some text inside the file being edited, and presses Ctrl+F3 not to search for other occurences of exactly the same text he/she selected, but to use the selected block as a regular expression for immediate searching. What a file should that be that it contains both real text and regular expressions for searching this text, at the same time? :-o
That’s exactly why I used the word “internally” when talking about escaping. How the text appears in the Find dialog is one thing – and I completely agree that automatic escaping here should be optional. But internal implementation is not restricted by this rule, because user does not see what is being done, he/she just sees the final result, so it does not matter if the text was escaped inside EE or not.June 30, 2011 at 4:23 am #9445zhouzh2Participant
+1 for Flint’s proposal.
There is no need to “internally” escape the selected text.
1. when no text selected, Ctrl+F3 finds the next exact word at cursor, so turn off regex and escape sequence, turn on search only word.
2. if text selected, Ctrl+F3 finds the selection, just turn off regex and escape sequence.
3. Ctrl+F will always use the word at cursor or the selected text, with options unchanged. Ctrl+F in 10.0.8 works just fine.
IMHO the current implementation of Ctrl+F3 is not “wrong”, but not “smart” enough :-)July 14, 2011 at 8:42 pm #9485Yutaka EmuraKeymaster
I will add a little smart way in the future version.
Thanks!June 2, 2015 at 10:18 am #20119
Version 15.1.2, still the same annoying problem…
- You must be logged in to reply to this topic.