We are matching the following value to print the string starting with comma using regular expression only.If we try to print last 5 digits only it is working fine.But for white spaces before that it is not working.How should we do that?COde we are using is as follows:-
$val="LOGANSPORT, IN 46947";
if(ereg(",? *[A-Z]{2} +([0-9]{5})$", $val,$combine))
{
echo "Combination is $combine[0]";
}
PHP version we are using is 4.2.1