I wondered if anyone can tell me a PHP regular expression to use which will return true if a string does not contain only numbers or is not 15-25 digits in length. Sorry if that’s a bit unclear.
I’m currently using:
!preg_match('/[0-9 ]{15, 25}/', $myString);
This works fine but I’m curious how to do it without putting NOT in front.
Sounds an awful lot like a homework question. But look at Escape Characters
and ask yourself “How do I check for the existance of a 0-14 digit string. Now, how do i check for anything that ISNT a digit? Now, how do I check for a 26+ digit string”
PS: Your line doesnt work. (Inside of a 30 digit string is a 25 digit string…)