Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Allow empty form fields regex

by tcf22 (Priest)
on Mar 18, 2004 at 16:07 UTC ( #337717=note: print w/replies, xml ) Need Help??


in reply to Allow empty form fields regex

How about this
if ((length($contents) > 0) && ($contents !~ /^[\w \.\,\=\" \/<>]+$/)) +{ $contentserror = "Error - message.";++$error; }
Also != should probably be !~.

- Tom

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://337717]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (6)
As of 2017-11-24 09:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (346 votes). Check out past polls.

    Notices?