I wrote a valitor class with a fair amount of regex in there.
Using Eclipse Regex Util, it is able to report regex pattern “mistakes”, so I’m wondering whether I could find a regex – or a php subclass – , to check that the regex pattern I’m calling is a correct regex pattern, nesting a dedicated in-class method, on top of checking/testing them unitary.
I wrote a valitor class with a fair amount of regex in there. Using
Share
The easiest way would be to just try using
preg_match()with the regex on an empty string; if it returnsFalse, an error has occurred, meaning that the pattern is invalid.