How to check if a string contains 3 or more consecutive number (We have to ignore this check for the number between the word starting with "border" and ending with ";")
Example : "border1234;" --> check should not be done for this string
Actually i am able to check if the string contains 3 or more consecutive numbers but i am not able to ignore this check for numbers between "border" and ";" phrases.
if (preg_match("/\d{3}/", $myString, $matches) > 0 ){
return true;
}
This should work :
/(?=.*\d{3,})(?!.*border\d{3,};)/
It matches any string that contains 3 or more consecutive digits except if those digits are between "border" and ";"