[PHP] validating input

2005-04-12 Thread blackwater dev
I want to check a string for only numbers and letters but am banging my head with regex: $good = joh_'; // Let's check the good e-mail if (preg_match(/[a-z0-9]/, $good)) { echo Good; } else { echo Bad; } This returns Good, why? Thanks! -- PHP General Mailing List

Re: [PHP] validating input

2005-04-12 Thread Chris Shiflett
blackwater dev wrote: I want to check a string for only numbers and letters but am banging my head with regex: ctype_alnum() Chris -- Chris Shiflett Brain Bulb, The PHP Consultancy http://brainbulb.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] validating input

2005-04-12 Thread trlists
On 12 Apr 2005 blackwater dev wrote: $good = joh_'; // Let's check the good e-mail if (preg_match(/[a-z0-9]/, $good)) { echo Good; } else { echo Bad; } This returns Good, why? That regex matches any string which contains at least one (lowercase) letter or one number

[PHP] Validating input

2005-01-28 Thread Ed Curtis
I've been looking at the docs and found preg_match and preg_match_all but these functions only seem to match 1 specific search item. I want to make sure a variable (say $mlsnumber) contains only numbers and no spaces. What would I use to accomplish this? Thanks Ed -- PHP General Mailing List

Re: [PHP] Validating input

2005-01-28 Thread trobi
Ed Curtis wrote / napsal (a): I've been looking at the docs and found preg_match and preg_match_all but these functions only seem to match 1 specific search item. I want to make sure a variable (say $mlsnumber) contains only numbers and no spaces. What would I use to accomplish this? Thanks Ed

Re: [PHP] Validating input

2005-01-28 Thread John Nichel
Ed Curtis wrote: I've been looking at the docs and found preg_match and preg_match_all but these functions only seem to match 1 specific search item. I want to make sure a variable (say $mlsnumber) contains only numbers and no spaces. What would I use to accomplish this? Thanks Ed You really don't

Re: [PHP] Validating input

2005-01-28 Thread John Nichel
John Nichel wrote: Ed Curtis wrote: I've been looking at the docs and found preg_match and preg_match_all but these functions only seem to match 1 specific search item. I want to make sure a variable (say $mlsnumber) contains only numbers and no spaces. What would I use to accomplish this?

Re: [PHP] Validating input

2005-01-28 Thread Chris Shiflett
--- Ed Curtis [EMAIL PROTECTED] wrote: I've been looking at the docs and found preg_match and preg_match_all but these functions only seem to match 1 specific search item. I want to make sure a variable (say $mlsnumber) contains only numbers and no spaces. What would I use to accomplish this?