[ale] perl regex.... again

Geoffrey Myers lists at serioustechnology.com
Tue Mar 1 06:53:07 EST 2011


Pat Regan wrote:
> 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";}'

I tried something like the above with [[:print:]], which I think covers 
the characters I want, but it did not work either.

> 
> Pat
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://mail.ale.org/mailman/listinfo/ale
> See JOBS, ANNOUNCE and SCHOOLS lists at
> http://mail.ale.org/mailman/listinfo


-- 
Until later, Geoffrey

"I predict future happiness for America if they can prevent
the government from wasting the labors of the people under
the pretense of taking care of them."
- Thomas Jefferson


More information about the Ale mailing list