Re: preg_match not working to full satisfaction

From: Date: Mon, 26 May 2003 12:04:47 +0000
Subject: Re: preg_match not working to full satisfaction
Groups: php.general 
Request: Send a blank email to php-general+get-148976@lists.php.net to get a copy of this message
Hello >> /^[a-zA-Z0-9]{10}$/ When you use double quoted strings don't forget to escape the $ since it indicates a variable or just use single quoted strings. I'm not sure but do you really want all your checked vars to be 10 characters long? The above pattern only matches when the string is contained of 10 alphanumeric letters so any string shorter than 10 or longer than 10 will not match. Maybe you just want /^[a-zA-Z0-9]{1,10}$/ or leave the {} part if you just want any length string. Regards Stefan Langer

« previous php.general (#148976) next »