diff --git a/phone.be.inc b/phone.be.inc
index 8e8f9eb..f683e52 100644
--- a/phone.be.inc
+++ b/phone.be.inc
@@ -20,13 +20,18 @@ function phone_be_metadata() {
  * @return boolean Returns boolean FALSE if the phone number is not valid.
  */
 function valid_be_phone_number($phonenumber) {
-  // define regular expression
-  $regex = "/^(\+32|0)[1-9]\d{7,8}$/i";
 
+  // define regular expression
+//$regex = "/^((?:00\)?\s?|\+)32\s?(?:0\s?)?|0)([1-9](\s?\d){7,8})$/i";
+  $regex = "/^(\(?(?:00\)?\s?\(?|\+)32\)?\s?\(?(?:0\)?\s?)?|0)([1-9](\)?\s?\d){7,8})$/i";
 
-  $phonenumber  = str_replace(array(' ','-','(',')'), '', $phonenumber);
-  // return true if valid, false otherwise
-  return (bool) preg_match($regex, $phonenumber);
+  if (!preg_match($regex, $phonenumber, $matches)) {
+    return FALSE;
+  } else {
+    $phonenumbernsn = str_replace(array(' ','-','(',')'), '', $matches['2']);
+    // return true if valid, false otherwise
+    return (bool) valid_be_phone_range($phonenumbernsn);
+  }
 }
 
 /**
@@ -37,13 +42,101 @@ function valid_be_phone_number($phonenumber) {
  */
 function format_be_phone_number($phonenumber, $field) {
 
+  // define regular expression
+//$regex = "/^((?:00\)?\s?\(?|\+)32\s?(?:0\s?)?|0)([1-9](\s?\d){7,8})$/i";
+  $regex = "/^(\(?(?:00\)?\s?\(?|\+)32\)?\s?\(?(?:0\)?\s?)?|0)([1-9](\)?\s?\d){7,8})$/i";
+
   $phonenumber = trim($phonenumber);
 
-   if ($field['phone_country_code']) {
-      if ($matches[1] != "+32") {
-  	$phonenumber = "+32" . " " . $phonenumber;
+  // get digits of phone number
+  if(!preg_match($regex, $phonenumber, $matches)) {
+    return $phonenumber . "NOT"; // not a BE number
+  } else {
+    $phonenumbernsn = str_replace(array(' ','-','(',')'), '', $matches['2']);
+    $phonenumbernsn = format_be_nsn($phonenumbernsn);
+    if ($field['phone_country_code']) {
+      $phonenumber = '+32' . ' ' . $phonenumbernsn;
+    } else {
+      if ($matches['1'] == "0") {
+        $phonenumber = "0" . $phonenumbernsn;
+      } else {
+        $phonenumber = '+32' . ' ' . $phonenumbernsn;
       }
-   }
-   
-   return $phonenumber;
+    }
+  }
+
+  return $phonenumber;
+}
+
+/**
+ * Verifies that $phonenumberNSN is a valid BE phone number range by initial
+ * digits and length. Tests the NSN part for length and number range.
+ * created by @g1smd
+ * 
+ * @param string $phonenumberNSN
+ * @return boolean Returns boolean FALSE if the phone number is not valid.
+ */
+function valid_be_phone_range($phonenumberNSN) {
+    // RegEx to define valid ranges for NSN by initial digits and length
+    $phonenumberNSN = trim($phonenumberNSN);
+    $patternBEvalidrange  = '/^';
+    $patternBEvalidrange .= '(?:';
+    $patternBEvalidrange .= '(?:1[0-69]|[23][2-8]|[49][23]|5\d|6[013-57-9]|7[18])\d{6}';
+    $patternBEvalidrange .= '|';
+    $patternBEvalidrange .= '8(?:0[1-9]|[1-69]\d)\d{5}';
+    $patternBEvalidrange .= '|';
+    $patternBEvalidrange .= '4(?:[679]\d|8[3-9])\d{6}';
+    $patternBEvalidrange .= '|';
+    $patternBEvalidrange .= '(?:90|7[07])\d{6}';
+    $patternBEvalidrange .= ')';
+    $patternBEvalidrange .= '$/x';
+    // Test NSN to see if it matches a valid number range
+    if (preg_match($patternBEvalidrange, $phonenumberNSN)) {
+        return TRUE;
+    } else {
+        return FALSE;
+    }
+}
+
+/**
+ * Format BE phone numbers in correct format per number range.
+ * created by @g1smd
+ *
+ * @param string $phonenumberNSN Must be the 8 or 9 digit NSN part of the number.
+ * @return string $phonenumberNSN Returns correctly formatted NSN by length and range.
+ */
+function format_be_nsn($phonenumberNSN) {
+    // Trim NSN
+    $phonenumberNSN = trim($phonenumberNSN);
+    // Find NSN string length
+    $phonenumberNSNLength = strlen($phonenumberNSN);
+    // RegEx patterns to define formatting by length and initial digits
+    $pattern9a = '/^(4[6-9]\d{7})$/';
+    $capture9a = '/^(4[6-9]\d)(\d{2})(\d{2})(\d{2})$/';
+    $pattern8a = '/^([23]\d{7}|[49][23]\d{6})$/';
+    $capture8a = '/^([2-49])(\d{3})(\d{2})(\d{2})$/';
+    $pattern8b = '/^([156]\d{7}|7[0178]\d{6}|80[1-9]\d{5}|[1-79]\d{7})$/';
+    $capture8b = '/^([15-8]\d)(\d{2})(\d{2})(\d{2})$/';
+    $pattern8c = '/^(800\d{5}|90\d{6})$/';
+    $capture8c = '/^([89]\d{2})(\d{2})(\d{3})$/';
+    // Format numbers by leading digits and length
+    if ($phonenumberNSNLength == 9 && preg_match($pattern9a, $phonenumberNSN)) {
+        if (preg_match($capture9a, $phonenumberNSN, $matches)) {
+            $phonenumberNSN = $matches['1'] . " " . $matches['2'] . " " . $matches['3'] . " " . $matches['4'];
+        }
+    } else if ($phonenumberNSNLength == 8 && preg_match($pattern8a, $phonenumberNSN)) {
+        if (preg_match($capture8a, $phonenumberNSN, $matches)) {
+            $phonenumberNSN = $matches['1'] . " " . $matches['2'] . " " . $matches['3'] . " " . $matches['4'];
+        }
+    } else if ($phonenumberNSNLength == 8 && preg_match($pattern8b, $phonenumberNSN)) {
+        if (preg_match($capture8b, $phonenumberNSN, $matches)) {
+            $phonenumberNSN = $matches['1'] . " " . $matches['2'] . " " . $matches['3'] . " " . $matches['4'];
+        }
+    } else if ($phonenumberNSNLength == 8  && preg_match($pattern8c, $phonenumberNSN)) {
+        if (preg_match($capture8c, $phonenumberNSN, $matches)) {
+            $phonenumberNSN = $matches['1'] . " " . $matches['2'] . " " . $matches['3'] . " " . $matches['4'];
+        }
+    }
+
+    return $phonenumberNSN;
 }
