CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Regular Expressions:
Newbie regex perplexity...



Nov 25, 2000, 8:23 AM

Post #1 of 2 (3751 views)
Newbie regex perplexity... Can't Post

I'm putting together a form validation/email CGI script and am completely new to Perl. The CGI part is actually working quite well, but I can NOT seem to get the hang of Perl's flavor of regex.

For form validation, I want to allow the user to enter the following characters in a telephone field:

0123456789-.() and spaces

How do I put togther the regex for this? Checking for numbers works great:

if ($value and $value =~ /\D/) {tag error here}

But EVERYTHING I've tried to allow typing the other characters causes the check to always fail. Can someone help me get my bearings here? Thanks!

[This message has been edited by parmenides (edited 11-25-2000).]

Enthusiast / Moderator

Nov 25, 2000, 8:42 AM

Post #2 of 2 (3751 views)
Re: Newbie regex perplexity... [In reply to] Can't Post

This topic is closed and has been moved to the "Regular Expressions" forum.

Jeff "japhy" Pinyan -- accomplished author, consultant, hacker, and teacher


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives