Skip to content

Instantly share code, notes, and snippets.

@SalvadorP
Created May 23, 2013 08:51
Show Gist options
  • Save SalvadorP/5633613 to your computer and use it in GitHub Desktop.
Save SalvadorP/5633613 to your computer and use it in GitHub Desktop.
Regular expressions for checking mobile phones from spain and france.
<?php
$regexES = "/^((0034|\+34|34){1})*(?(?=6)(6){1}[0-9]{8}|(7){1}[1-9]{1}[0-9]{7})$/";
$regexFR = "/^((0033|\+33|33){1})*(?(?=0)(06|07){1}[0-9]{8}|(6|7){1}[0-9]{8})$/";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment