DD
DevDash

Regex for French Phone Number

Regex Pattern

^(?:\+33|0)[1-9](?:[\s.-]?\d{2}){4}$

French phone number with optional +33 country code

Quick Answer

The regex pattern for french phone number is `^(?:\+33|0)[1-9](?:[\s.-]?\d{2}){4}$`. French phone number with optional +33 country code. This works in JavaScript, Python, Ruby, PHP, Java, and most regex engines that support PCRE syntax.

Test Examples

InputResult
+33612345678✓ Matches
0612345678✓ Matches
+33 6 12 34 56 78✓ Matches
+33012345678✗ No match
12345678✗ No match
+44612345678✗ No match

Code Examples

javascript

const regex = /^(?:\+33|0)[1-9](?:[\s.-]?\d{2}){4}$/;
const isValid = regex.test(value);

python

import re
pattern = r'^(?:\+33|0)[1-9](?:[\s.-]?\d{2}){4}$'
if re.match(pattern, value):
    print("valid")

ruby

pattern = /^(?:\+33|0)[1-9](?:[\s.-]?\d{2}){4}$/
if value =~ pattern
  puts "valid"
end

php

if (preg_match('/^(?:\+33|0)[1-9](?:[\s.-]?\d{2}){4}$/', $value)) {
    echo "valid";
}

java

String pattern = "^(?:\\+33|0)[1-9](?:[\\s.-]?\\d{2}){4}$";
boolean isValid = value.matches(pattern);

Frequently Asked Questions

Related Regex Patterns

Want API access + no ads? Pro coming soon.