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