Am 05.10.2011 um 5, 19:52 schrieb Løseth Tor Rafsol:
>>> Any suggestion on how to negate this expression so that it finds all the 
>>> words that are not 6 characters long?
>> 
>> If you think about it another way, you want to find words that are either
>> 1-5 characters long or 7+ characters long:
>> 
>> ^(?:\w{1,5}|\w{7,})$
> Thank you for that one Ronald, it did the trick :)
> 
> But are there really no other way to do it with a caret or assertion? 
> Just to keep complexity/readability down. Not that this one qualified for 
> that ;-)


In my humble opinion every regular expression shorter than 25 characters 
qualifies per se as simple and readable :-)

Now, trying to give an answer to your question: I'm not sure if there is a 
simpler solution of expressing your intended search. But: Why not combine your 
original search pattern ^[\w]{6}$ (or the slightly shorter version ^.{6}$  ) 
with BBEdit's fine "Text > Process Lines Containing" command. It gives you the 
opportunity to search your document "regular", to delete the found lines and/or 
to copy them to a new document. This may be the way to finish your task elegant 
and quickly.

Regards,
Roland

-- 
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