- The first Regular Expression Library on the Web!

Please support RegExLib Sponsors


Regular Expression Details

Title Test Find Facebook Pages
Validating a Facebook page can be a little bit tricky. This is because there are two valid formats. The first is, the second is designed for big business which grants them a clean url such as I see this regex being used in a user profile admin page and I think it does a good enough job for this purpose. The problem is bad urls could slip through which meet the criteria for the clean facebook page url but aren't in valid pages on the site. The main example being that an incomplete numbered url could slip through as would validate. Facebook also uses various subdomains such as to provide localised versions of the site. This regex will accept a prefix of either www or a locale code of two letters dash two letters. It doesn't validate the actual country code though. [UPDATED] Added full stop to list of valid characters for page names.
Matches | | | |
Non-Matches | |
Author Rating: Not yet rated. Matthew Harris
Your Rating
Bad Good

Enter New 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

Copyright © 2001-2015, | ASP.NET Tutorials