[phpug] Re: sanity checking

2009-01-21 Thread Bob M Brown
Assuming you meant 0-9 OR a-z ... if (preg_match('/^[a-z0-9]/',$string)) { ... } The ^ in the regular expression anchors it to the start of the string. Similarly, if you wanted to check that the string ENDED with the same criteria then you would anchor the test to the end of the string

[phpug] Re: sanity checking

2009-01-21 Thread Michael
On Thu, 22 Jan 2009 20:13:43 Bob M Brown wrote: preg_match('/^[a-z0-9]/',$string) That's what I needed. Thank you :-) --~--~-~--~~~---~--~~ NZ PHP Users Group: http://groups.google.com/group/nzphpug To post, send email to nzphpug@googlegroups.com To