Possible Duplicate:
What regular expression can never match?
how do i write a regular expression which returns false always in php.
i wanted this bcos . i wanted to display a error msg with out a form rule…so i did like this..
if($values['result_msg'] == 'ERROR')
{
$form->registerRule('just_check','regex','/$^/');
$form->addRule('abc', 'Please enter valid Model Number.','just_check');
}
There are lots of ways to do it:
/(?=a)b/This fails to match because it searches for a character which is both a and b.
/\Zx\A/This fails to match because the end of the string cannot come before the start of the string.
/x\by/This fails to match because a word boundary cannot be between the characters
xandy.