Skip to main content
Regexflux

German Phone Number

intermediate

Matches German phone numbers with optional country code.

phonegermanyvalidation

Pattern

/(?:\+49[\s-]?|0)\d{2,5}[\s-]?\d{3,}[\s-]?\d{0,4}/g

Try It

0 of 6 strings matched

Explanation

Matches German phone numbers starting with +49 or 0, with variable-length area codes (2-5 digits) and subscriber numbers.

Test Strings

Matching

  • +49 30 12345678
  • 030 12345678
  • +49-89-123456

Non-matching

  • +1-555-1234
  • 12345
  • abc

Language Compatibility

LanguageSupport
JSFull support
PYTHONFull support
JAVAFull support
PHPFull support
GOFull support

Code Snippets

const regex = /(?:\+49[\s-]?|0)\d{2,5}[\s-]?\d{3,}[\s-]?\d{0,4}/g;
const text = "your text here";
const matches = text.match(regex);
console.log(matches);

Related Patterns