Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Re: Allow empty form fields regex

by Hissingsid (Sexton)
on Mar 18, 2004 at 16:55 UTC ( [id://337736]=note: print w/replies, xml ) Need Help??


in reply to Re: Allow empty form fields regex
in thread Allow empty form fields regex

Hi,

Thanks for the excellent input.

I played around a bit and this is what I have got working perfectly.

if (($contents ne "") && (!($contents =~ /^[\w \.\,\=\" \/<>]+$/))){ $contentserror = "Error - message.";++$error; }
For some reason this != was not helping the situation.

Anyway Paladin, a big thanks I had been fiddleing for hours and now have a good solution thanks to your suggestion.

Best wishes

Sid

Edit by castaway, added code tags

Replies are listed 'Best First'.
Re: Re: Re: Allow empty form fields regex
by Hissingsid (Sexton) on Mar 18, 2004 at 17:18 UTC
    Apologies guys I missed the bit about !=/!~

    !~ does indeed work removing the need for some of the ()s.

    Many thanks Sid

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://337736]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2024-04-24 02:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found