RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Pattern Title
Expression
^[0-9]{2,3}-? ?[0-9]{6,7}$
Description
Validates Spain Phones
Matches
972367087 | 97-3770866 | 972-377086
Non-Matches
9988-989898 | 989898988989 | 9 9898989898
Author Rating: Not yet rated. Francesc Vila
Source
Your Rating
Bad Good

Enter New Comment

Title
 
Name
 
Comment
 
Spammers suck - we apologize. Please enter the text shown below to enable your comment (not case sensitive - try as many times as you need to if the first ones are too hard):

Existing User Comments

Title: Issue found
Name: RG
Date: 8/31/2010 11:22:38 PM
Comment:
As standard phone numbers in Spain are of length '9' but this expression will also validate number of length '10' (Telephone number is entered without '-' or space). How to prevent this in regular expression only?


Copyright © 2001-2024, RegexAdvice.com | ASP.NET Tutorials