|  | Posted by Mark Woodward on 10/12/06 11:42 
On Wed, 11 Oct 2006 22:40:05 +1000, Mark Woodward wrote:
 > Hi all,
 >
 > I'm trying to validate text in a HTML input field.
 > How do I *allow* a single quote?
 >
 > // catch any nasty characters (eg !@#$%^&*()/\)
 > $match = '/^['\w\.\-_?!, ]+$/';
 > $valid_srch = preg_match($match, $res_description);
 > if (!$valid_srch) {
 >     ...
 > }
 >
 >
 >
 > for $match I've also tried:
 >
 > $match = '/^[\'\w\.\-_?!, ]+$/';
 >
 > $match = '/^["\w\.\-_?!, ]+$/';
 >
 > $match = "/^['\w\.\-_?!, ]+$/";
 >
 > $match = "/^[\'\w\.\-_?!, ]+$/";
 >
 > and numerous other strings but always ' is seen as an
 > invalid character.
 >
 >
 > thanks,
 
 Peter/ Pedro,
 
 sorry I haven't responded. All good now. I decided to attack it from a
 different angle (put it on the TODO pile ;-)).
 
 thanks,
 
 --
 Mark
  Navigation: [Reply to this message] |