david wrote:
> Bob Showalter wrote:
> >
> >$error = "Message required" unless $text =~ /[:alpha:]/;
> >
>
> is this a new syntax? or should it be:
>
> $error = "Message required" unless text =~ /[[:alpha:]]/;
Nope, you're right. Sorry 'bout that.
The POSIX character classes must appear wi
LS> I have a script that is used for text messaging. I added a
LS> line of code to check to make sure that input is in a field
LS> before the message is sent. My code is as follows:
LS>
LS> if($b !~ m/^\w[\w\s]*\w$/) { $error .= "Enter a message \n"; }
LS>
LS> This fails if the field has any
Bob Showalter wrote:
>
>$error = "Message required" unless $text =~ /[:alpha:]/;
>
is this a new syntax? or should it be:
$error = "Message required" unless text =~ /[[:alpha:]]/;
david
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
On Mon, 27 Jan 2003, Liebert, Sander wrote:
> Date: Mon, 27 Jan 2003 12:54:04 -0600
> From: "Liebert, Sander" <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: Regular Expression's and punctuation
>
> I have a script that is used for text messaging. I added a line of code to
> check to make
>I have a script that is used for text messaging. I added a line of code to
>check to make sure that input is in a field before the message is sent. My
>code is as follows:
>
>if($b !~ m/^\w[\w\s]*\w$/) { $error .= "Enter a message \n"; }
>
>This fails if the field has any punctuation characters.
>
> I have a script that is used for text messaging. I added a
> line of code to check to make sure that input is in a field
> before the message is sent. My code is as follows:
>
> if($b !~ m/^\w[\w\s]*\w$/) { $error .= "Enter a message \n"; }
>
> This fails if the field has any punctuatio
Liebert, Sander wrote:
> I have a script that is used for text messaging. I added a line of
> code to check to make sure that input is in a field before the
> message is sent. My code is as follows:
>
> if($b !~ m/^\w[\w\s]*\w$/) { $error .= "Enter a message \n"; }
>
> This fails if the field ha