When I search a file using grep's -w switch, or using the "whole word" search option in other editors, if the search term begins or ends with a non-word character, the editors I tested will still find the match, but Geany does not.
For instance, Geany does not treat "return;" (sans quotes) in the same way as (most?) other editors.[1]
Is this a bug, or intended behavior?
- Jeff
[1] NEdit,SciTE,Metapad,Delphi,CRedit,ConTEXT,gnumeric
On Fri, 25 Jan 2008 13:02:20 -0600 "Jeff Pohlmeyer" yetanothergeek@gmail.com wrote:
When I search a file using grep's -w switch, or using the "whole word" search option in other editors, if the search term begins or ends with a non-word character, the editors I tested will still find the match, but Geany does not.
For instance, Geany does not treat "return;" (sans quotes) in the same way as (most?) other editors.[1]
Is this a bug, or intended behavior?
Intended behaviour - although maybe it could be improved. At least a warning would be useful instead of the search failed message.
What behaviour do the other editors do - switch off word matching if the search string contains a non-word character?
Regards, Nick
On Jan 28, 2008 7:34 AM, Nick Treleaven nick.treleaven@btinternet.com wrote:
What behaviour do the other editors do - switch off word matching if the search string contains a non-word character?
If the beginning or ending character of the search phrase is a non-word character, then it considers that edge to always be a whole word match. In other words "def." would match in "abc.def.ghi" but not in "ab.cdef.ghi"
You can try grep's -w switch to get the idea.
- Jeff