regex - PHP code with regexp for dutch phone are not working -


i used expression solution given in regular expression dutch phone number php code below, code not working.

the code simple don't see go wrong ?

define("regexp_phone_nl","(^\+[0-9]{2}|^\+[0-9]{2}\(0\)|^\(\+[0-9]{2}\)\(0\)|^00[0-9]{2}|^0)([0-9]{9}$|[0-9\-\s]{10}$)");  $string = "+31123456789"; //based on solution given in https://stackoverflow.com/questions/17949757/regular-expression-for-dutch-phone-number  echo(filter_var($string, filter_validate_regexp,array("options"=>array("regexp"=>regexp_phone_nl)))); 

regex works, forgot put same characters in beginning , in end of pattern (delimeters).

<?php     define("regexp_phone_nl","/(^\+[0-9]{2}|^\+[0-9]{2}\(0\)|^\(\+[0-9]{2}\)\(0\)|^00[0-9]{2}|^0)([0-9]{9}$|[0-9\-\s]{10}$)/");     $string = "+316123456789"; //based on solution given in http://stackoverflow.com/questions/17949757/regular-expression-for-dutch-phone-number     var_dump(filter_var($string, filter_validate_regexp,array("options"=>array("regexp"=>regexp_phone_nl)))); 

see working here.


Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -