Sublime Forum

Find text do not work

#1

when find text $zone with “whole word” flag enabled it find nothing

Allow to find ‘$zone’ in text like:

my $zone = ‘zone string’;

0 Likes

#2

I tried this out of curiosity and, yes, when “Whole Word” option is on you will not find the suggested text.

I can only surmise this is because ‘$zone’ is not considered a ‘word’. If you substitute the $ for any other symbol the same result is given.
Clearly then the title of this thread is incorrect, ‘find text DOES work’, when you understand the the constraints of the find options.

In your example there is no practical reason why you would need to use “Whole Word” to search for instances of ‘$zone’, just do a ‘regular’ search.

0 Likes

#4

In case anyone googling this issue winds up here as I did:

Sublime Text uses the regexp meaning of Whole Word - using \b as start/end delimiters, and assumes \w* in-between. This convention does not allow for a special character inside it.

What I’m doing now is leaving Regular Expression on for Find, and if I want, e.g., $zone and only $zone, I use \$zone\b to get real close.

0 Likes