In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED]
(Lee Stretton) wrote:
<snip>
> elseif( preg_match( "/^[a-zA-Z]+$/", $arg[$i], $matches ) )
<snip>
> elseif( preg_match( "/(div\d|prem)/", $arg[$i], $matches ) )
<snip>
> The first 3 work fine, but the last one "/(div\d|prem)/" doesnt work
> properly. It does work if I have say div1, but if I have prem it doesnt
> work at all. I have tried changing the regex so it only contains
> "/prem/" and it still doesnt work. can anyone tell me what is wrong with
> this code, or is it just a bug in my version of php?
Your earlier test for "/^[a-zA-Z]+$/" catches any string that is all
letters from beginning to end. Thus a string == "prem" would be caught
above, and never reach the test for "/(div\d|prem)/".
--
CC
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]