[ale] perl regex.... again
Geoffrey Myers
lists at serioustechnology.com
Mon Feb 28 15:38:37 EST 2011
Watson, Keith wrote:
>> -----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
>> 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
>
> Geoffrey,
>
> if ($line =~ /[^\040-\176]/) {
>
> print ("Line contains out of range characters\n");
>
> }
>
> keith
Does not pick up an string that contains an embedded character outside
the range. Say:
This is a bad ^G line.
--
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