> Oliver Taylor <[email protected]> Oct 17 03:10PM -0700
>
> I'm trying to write a different kind of "Select Word" script...
> ...with a chain of grep searches.
>
> 1. Start by looking at the character to the right of the insertion point.
> 2. If that character is a space, then move to the beginning of the word...
> 3. and then select to the end of the word

The general approach is not bad but I think you are working too hard
to find word boundaries, when the \b "word boundary" is already
in grep. And, you are using \w "word character" but there is also \W,
"not a word character" that matches anything \w does not match.

So one way to find a word is to look forward for \W then back for \W\w+
however this is not going to hit at beginning or end of line (of file,
if ?-m given), so \b\w+\b is perhaps a better choice.

-- 
-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
<http://groups.google.com/group/bbedit?hl=en>
If you have a feature request or would like to report a problem, 
please email "[email protected]" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>



Reply via email to