[PHP-DB] regex question

2005-03-07 Thread Chip Wiegand
I am writing some regex on a php form to validate input and have come up with this, for example - if (empty($first) || !eregi(^[A-Za-z]+[- ]?[A-Za-z]+$, $first)) for checking a persons name. This allows a single name, or a hyphenated double name, or a non-hyphenated double name, and it works.

Re: [PHP-DB] regex question

2005-03-07 Thread Martin Norland
Chip Wiegand wrote: I am writing some regex on a php form to validate input and have come up with this, for example - if (empty($first) || !eregi(^[A-Za-z]+[- ]?[A-Za-z]+$, $first)) for checking a persons name. This allows a single name, or a hyphenated double name, or a non-hyphenated double

Re: [PHP-DB] regex question

2005-03-07 Thread W. D.
At 11:04 3/7/2005, Chip Wiegand wrote: I am writing some regex on a php form to validate input and have come up with this, for example - if (empty($first) || !eregi(^[A-Za-z]+[- ]?[A-Za-z]+$, $first)) for checking a persons name. This allows a single name, or a hyphenated double name, or a