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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Guid
Expression
^(?<BRACE>\{)?[a-fA-F\d]{8}-(?:[a-fA-F\d]{4}-){3}[a-fA-F\d]{12}(?<-BRACE>\})?(?(BRACE)^.)$
Description
Matches a string representation of a Guid, regardless of case, and does the correct brace matching
Matches
99283723-0938-0a9f-8b7c-029cba98d789 | {99283723-0938-0a9f-8b7c-029cba98d789} | {99283723-0938-0a9f-8b7c-029CBA98D789}
Non-Matches
{99283723-0938-0a9f-8b7c-029cba98d789 | 99283723-0938-0a9f-8b7c-029cba98d789} | 99283723-0938-0s9f-8b7c-029cba98d789
Author Rating: Not yet rated. Ryan Schreiber
Source http://www.darkside.co.za/archive/2010/09/03/regex-guid.aspx
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

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