note 32149 deleted from ref.pcre by sniper
| From: | sniper@php.net | Date: | Tue, 30 Sep 2003 12:18:19 +0000 |
| Subject: | note 32149 deleted from ref.pcre by sniper | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-57411@lists.php.net to get a copy of this message | ||
Note Submitter: mrPuta@yahoo.com.au
----
How to have optional spaces. For beginners like me.
I finally found the solution.
I need this so a surname like mine will 'match'. eg. 'De David'
<?function eregi_alpha_sp( $data ) {
if ( eregi('^[[:alpha:]| ]+$', $data) ) {return true;}
return false; }?>
The spaces bit, is '| ]'. The 'pipe' meaning OR and a space.
So, the expression is Alpha OR Space