Common Regular Expressions

All regular expressions found here should be PCRE compatible.

Test for valid IPv4 address
/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/

1
<strong>    Regex flavors:</strong> .NET, Java, JavaScript, PCRE, Perl, Python, Ruby

 


Validate international phone numbers in EPP format

1
2
    <span style="color: #666699;">^\+[0-9]{1,3}\.[0-9]{4,14}(?:x.+)?$</span>
<strong>    Regex flavors:</strong> .NET, Java, JavaScript, PCRE, Perl, Python, Ruby

 


See Also

http://blog.stevenlevithan.com/archives/validate-phone-number

Leave a Reply