The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 |
Newsgroups: comp.lang.perl.modules
From: "George Mpouras" <nospam.gravital...@hotmail.com.nospam>
Date: Wed, 23 May 2012 13:35:17 +0300
Local: Wed, May 23 2012 6:35 am
Subject: printable characters
I have the regex
my $regex = qr/^([\w `^~!@;:,+%&|<>{}()=\-\$\*\?\[\]\\\.\/\'"#]*)$/;
for matching the printable characters `^~!@#$%&*?_+-={}[]()<>;:'"|\,./ a..z A..Z 0..9
is there any better approach ?
You must Sign in before you can post messages.
You do not have the permission required to post.
|
 |
Newsgroups: comp.lang.perl.modules
From: Jim Gibson <jimsgib...@gmail.com>
Date: Wed, 23 May 2012 12:35:04 -0700
Local: Wed, May 23 2012 3:35 pm
Subject: Re: printable characters
In article <jpieg9$1io...@news.ntua.gr>, George Mpouras
<nospam.gravital ...@hotmail.com.nospam> wrote:
> I have the regex
> my $regex = qr/^([\w `^~!@;:,+%&|<>{}()=\-\$\*\?\[\]\\\.\/\'"#]*)$/;
> for matching the printable characters `^~!@#$%&*?_+-={}[]()<>;:'"|\,./ > a..z A..Z 0..9
> is there any better approach ?
You can try the Posix character classes [[:print]], which includes
"printable" whitespace, and [[:graph:]], which does not.
See 'perldoc perlrecharclass' for other forms.
-- Jim Gibson
You must Sign in before you can post messages.
You do not have the permission required to post.
|
 |
Newsgroups: comp.lang.perl.modules
From: Jürgen Exner <jurge...@hotmail.com>
Date: Thu, 24 May 2012 20:48:59 -0700
Local: Thurs, May 24 2012 11:48 pm
Subject: Re: printable characters
"George Mpouras" <nospam.gravital ...@hotmail.com.nospam> wrote:
>I have the regex
>my $regex = qr/^([\w `^~!@;:,+%&|<>{}()=\-\$\*\?\[\]\\\.\/\'"#]*)$/;
>for matching the printable characters `^~!@#$%&*?_+-={}[]()<>;:'"|\,./ >a..z A..Z 0..9
Luckily you are mistaken because depending on your locale \w will match
much more than just those limited ASCII characters .
>is there any better approach ?
Use the class [[:print:]]
Oh, and no, you don't need modules for this.
jue
You must Sign in before you can post messages.
You do not have the permission required to post.
|
|
|