[ale] perl regex.... again

Pat Regan thehead at patshead.com
Mon Feb 28 17:47:47 EST 2011


On Mon, 28 Feb 2011 16:44:13 -0500
"Michael H. Warfield" <mhw at wittsend.com> wrote:

> Yeah, strong suspicion you can not do \OOO inside a regex.  From the
> man page:
> 
> man 7 regex
> 
> ==
> ...  all other special characters, including '\', lose their special
> significance within a bracket expression.
> == 

Ah, pants.  I just assumed it would work.  The syntax sure looked
right!

This seems to work pretty well on some random text files.  It might be
missing some characters he wants to match, but it should be a good
start:

perl -ne 'if(/[^[:alnum:][:punct:]\s]/) {print "bad line:$_\n";}'

Pat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
Url : http://mail.ale.org/pipermail/ale/attachments/20110228/e7d4d8c9/attachment.bin 


More information about the Ale mailing list