Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
printable characters
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
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
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
George Mpouras  
View profile  
 More options May 23 2012, 6:35 am
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.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jim Gibson  
View profile  
 More options May 23 2012, 3:35 pm
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.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jürgen Exner  
View profile  
 More options May 24 2012, 11:48 pm
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.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »