using System;
using System.Text.RegularExpressions;
public static class GuidUtility
{
public static bool IsGuid( string guid )
{
if ( !string.IsNullOrEmpty( guid ) )
{
Regex regex = new Regex( @"^(\{{0,1}([0-9a-fA-F]){8}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){12}\}{0,1})$" );
return regex.IsMatch( guid );
}
return false;
}
}
No comments:
Post a Comment