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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Pattern Title
Expression
^\{?[a-fA-F\d]{8}-([a-fA-F\d]{4}-){3}[a-fA-F\d]{12}\}?$
Description
Validates a GUID with and without brackets. 8,4,4,4,12 hex characters seperated by dashes.
Matches
{e02ff0e4-00ad-090A-c030-0d00a0008ba0} | e02ff0e4-00ad-090A-c030-0d00a0008ba0
Non-Matches
0xe02ff0e400ad090Ac0300d00a0008ba0
Author Rating: Not yet rated. Lewis Moten
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: Allows GUIDs with one bracket.
Name: Nurgling
Date: 5/20/2005 3:38:25 AM
Comment:
[{e02ff0e4-00ad-090A-c030-0d00a0008ba0] [e02ff0e4-00ad-090A-c030-0d00a0008ba0}] both pass when I think they should fail.


Title: Oooppsss
Name: Tony
Date: 5/19/2004 4:19:00 PM
Comment:
I forgot the question mark at the end... \{?[a-fA-F\d]{1,8}-(?:[a-fA-F\d]{1,4}-){3}[a-fA-F\d]{1,12}\}?


Title: Very usefull
Name: Tony
Date: 5/19/2004 4:16:53 PM
Comment:
Here is a suggestion to improve the detection: \{?[a-fA-F\d]{1,8}-(?:[a-fA-F\d]{1,4}-){3}[a-fA-F\d]{1,12}\} (tested with .Net RegExp implementation) This one find the guid even if not all the zeros are specified. Plus, it matches only the GUID as a whole and no parts of it.


Title: saved me a half-hour
Name: mr_luc
Date: 4/15/2004 12:06:35 PM
Comment:
What can I say -- this was exactly what I googled for, and this tidbit delivered. Time until problem patched: 7 minutes est instead of half-hour est.


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