diff --git a/include/phone.es.inc b/include/phone.es.inc
index 8558044..ee2d638 100644
--- a/include/phone.es.inc
+++ b/include/phone.es.inc
@@ -24,19 +24,17 @@ function valid_es_phone_number($phonenumber) {
   $phonenumber = trim($phonenumber);
 
   // define regular expression
-  //$regex = "/
-  //  \D*           # optional separator
-  //  [69]\d{2}     # first group of numbers
-  //  \D*           # optional separator
-  //  \d{3}         # second group
-  //  \D*           # optional separator
-  //  \d{3}         # third group
-  //  \D*           # ignore trailing non-digits
-  //  $/x";
-    
-    $regex = '/^[0-9]{2,3}-? ?[0-9]{6,7}$/';
+  $regex = '/
+        \D*                  # optional separator
+        (\+[0-9]{2})?    # optional international code
+        \D*                  # optional separator
+        \d{3}                # first number group
+        \D*                  # optional separator
+        \d{3}                # second number group
+        \D*                  # optional separator
+        \d{3}                # third number group
+      $/x';
 
-    
   // return true if valid, false otherwise
   return (bool) preg_match($regex, $phonenumber);
 }
@@ -50,24 +48,27 @@ function valid_es_phone_number($phonenumber) {
 function format_es_phone_number($phonenumber, $field = FALSE) {
 
   // define regular expression
-  //$regex = "/
-  //  \D*           # optional separator
-  //  ([69]\d{2})   # first group of numbers
-  //  \D*           # optional separator
-  //  (\d{3})       # second group
-  //  \D*           # optional separator
-  //  (\d{3})       # third group
-  //  \D*           # ignore trailing non-digits
-  //  $/x";
-
-  $regex = '/^[0-9]{2,3}-? ?[0-9]{6,7}$/';
+  $regex = '/
+        \D*                  # optional separator
+        (\+[0-9]{2})?    # optional international code
+        \D*                  # optional separator
+        (\d{3})              # first number group
+        \D*                  # optional separator
+        (\d{3})              # second number group
+        \D*                  # optional separator
+        (\d{3})              # third number group
+      $/x';
   
   // get digits of phone number
   preg_match($regex, $phonenumber, $matches);
 
   // construct ten-digit phone number
-  $phonenumber = $matches[1] . ' ' . $matches[2] . ' ' . $matches[3];
+  if ($matches[1] > 0) {
+    $phonenumber = $matches[1] . ' ' . $matches[2] . ' ' . $matches[3] . ' ' . $matches[4] ;
+  }
+  else {
+    $phonenumber = $matches[2] . ' ' . $matches[3] . ' ' . $matches[4];
+  }
 
   return $phonenumber;
-}
-
+}
\ No newline at end of file
