I want to check if phone no contains this pattern AABBCC Where A[0-9],B[0-9],C[0,9] They should be different e.g 112233,553322,887766
Let Us Suppose I Have a phone no 03334112233 It will say yes pattern matched.
PHP Code but It Is For Exact String
$str = 'aabbaabbccaass'; //or whatever
if (preg_match('/(?!.*?aabbcc)^.*$/', $str))
echo "accepted\n";
else
echo "rejected\n";
Problem i don't know how to do if string is for numbers
Possible Duplicate but it does not contain answer and exact detail.
Edited : I want to match the last 6 characters of the string in this pattern AABBCC e.g 03329112233