diff --git a/components/number.inc b/components/number.inc
index cd00835..7a501b5 100644
--- a/components/number.inc
+++ b/components/number.inc
@@ -809,6 +809,10 @@ function webform_number_format_match($value, $point, $separator) {
   //   3. optional integer portion, with thousands separators
   //   4. optional decimal portion, starting is a decimal separator
 
+  // Escape separator if it is a space since the regex is using the /x flag.
+  if ($separator === ' ') {
+    $separator = '\\' . $separator;
+  }
   $thousands = $separator ? (preg_quote($separator, '/') . '?') : '';
   $decimal = preg_quote($point, '/');
   return preg_match("/
