Hi again,

On 24 August 2012 00:32, Oliver Taylor <olivertay...@me.com> wrote:
> My first approach to this problem was identical to yours, look for the
> boundary between a word character and a word border. But this is no
> different than using the option-right-arrow shortcut.

It is slightly different in that it doesn’t match “word boundaries”
immediately after punctuation. Although I can see that is a useful
distinction.

> I'm defining exactly what I think is punctuation should be, and where BBEdit
> should move within it, instead of leaving it up to BBEdit. For example: with
> the word "can't" your script (and BBEdit's built-in movement) moves between
> the N and the apostrophe, mine moves to the end of the actual word.

> tell application "BBEdit"
> find "(?<=[\\w\\d]|$)(?=$|['\\\"][ )\\]}?!\\-\\.,;:\\*_$]|
> |[)\\]}?!\\-\\.,;:\\*_])" searching in text of front text window options
> {search mode:grep} with selecting match
> end tell

I’m curious, what punctuation would this regex not account for?:

(?<=\w)\b(?![^\w\s]\w)

Cheers Ollie
--
@ollicle

-- 
-- 
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 "supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>



Reply via email to