RE: [PHP] Allowing punctuation marks in regular expressions

2003-06-06 Thread John W. Holmes
> I tried adding a period to the end but a string will a period still > returns > false > > function is_alphanumeric($string) > { > return (preg_match("/^[A-Za-z0-9.]+$/i", $string)); > } No it doesn't. It's not allowing spaces, though... Is that the problem? ---John W. Holmes... Amazon W

Re: [PHP] Allowing punctuation marks in regular expressions

2003-06-06 Thread Leif K-Brooks
It's using the case-insensitive switch. Dan Joseph wrote: Also, if you want upper case letters, make sure you add A-Z: -- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law. -- PHP General Mailin

RE: [PHP] Allowing punctuation marks in regular expressions

2003-06-06 Thread Luis Lebron
2:42 PM To: Php-General (E-mail) Subject: RE: [PHP] Allowing punctuation marks in regular expressions Hi, > return (preg_match("/^[a-z0-9]+$/i", $string)); That a-z0-9 is where you can do it. Just add ! or . or ? to the end: a-z0-9!?. Also, if you want u

RE: [PHP] Allowing punctuation marks in regular expressions

2003-06-06 Thread Dan Joseph
Hi, > return (preg_match("/^[a-z0-9]+$/i", $string)); That a-z0-9 is where you can do it. Just add ! or . or ? to the end: a-z0-9!?. Also, if you want upper case letters, make sure you add A-Z: A-Za-z0-9!?. -Dan Joseph -- PHP General Mailing List (http