[ale] perl regex.... again

John Scott John.Scott at peak10.com
Mon Feb 28 20:40:08 EST 2011


Geoffrey Wrote:

> I'm trying to come up with a perl regex that will identify a line of data that has any 
> character outside of alphanumeric, punctuation, spaces, tabs.

Taking a crack:

"if ($line !~ /[\d\s\w\\\|\(\)\[\{\^\$\*\+\?\.\<\>,:\;"']/) {
}"

Basically it's just the "if ($line !~ /[\d\s\w]/)" part, but adding all the punctuation you need.
The punctuation is the hard part.  The rest is easy, as you know.

I have not tested this before sending.  This is just a quick crack at it.
 
-John

-----Original Message-----
From: ale-bounces at ale.org [mailto:ale-bounces at ale.org] On Behalf Of Geoffrey Myers
Sent: Monday, February 28, 2011 12:59 PM
To: Atlanta Linux Enthusiasts
Subject: [ale] perl regex.... again

I'll try this again as I didn't get any bites before.  I'm trying to 
come up with a perl regex that will identify a line of data that has any 
character outside of alphanumeric, punctuation, spaces, tabs.

Can't seem to formulate.

anyone?

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



More information about the Ale mailing list