[eluser]samitrimal[/eluser]
Hi i have a problem in using dollor sign in my regular expression . When i dont use dollar sign it works fine.Here is a code
Code:
$pattern="/^[^0-9][0-5a-zA-Z]{1,}([a-zA-Z0-9_|-])*$/";
if (preg_match($pattern, "a12-|", $matches)) {
echo "Match was found <br />";
echo $matches[0];
}
else{
echo "Pattern does not match";
}
The error occours when i use dollor sign.
Code:
$pattern="/^[^0-9][0-5a-zA-Z]{1,}([a-zA-Z0-9_|-$])*$/";
if (preg_match($pattern, "a12-|$", $matches)) {
echo "Match was found <br />";
echo $matches[0];
}
else{
echo "Pattern does not match";
}
I encountered the following error
Code:
Warning: preg_match() [function.preg-match]: Compilation failed: range out of order in character class at offset 36 in E:\wamp\www\graph\testpractice\php\regex\pregmath.php on line 3
need help to solve this problem