The FILTER_VALIDATE_REGEXP filter validates values against a Perl-compatible regular expression.
Name: "validate_regexp"
ID-number: 272
Possible options:
regexp - specifies the regular expression against which validation is based
<?php$string = "Match this string";var_dump(filter_var($string, FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>"/^M(.*)/"))))? >
The output of the code looks like this:
string(17) "Match this string"