At 18:58 +0200 5/10/11, Løseth Tor Rafsol wrote:

I have a list of words that are separated by carriage returns.
This finds words that are 6 characters long:
^[\w]{6}$

Any suggestion on how to negate this expression so that it finds all the words that are not 6 characters long?

If you want to avoid the verbosity of AppleScript, this text filter will do what you want:

#/usr/bin/perl
while (<>){
  s~\b(\w{1,5}|\w{7,})\b~\U$&~g;
  print;
}

or

#!perl -p
s~\b(\w{1,5}|\w{7,})\b~\U$&~g;


Otherwise in the substitution expression s~find~replace~ you need to change Perl's '$&' to BBEdit's (PCRE's) '\0'

This will change all words in the document (or selection) not 6 characters long to upper case.

JD

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