G
Greg Merideth
I came up with this to test strings passed into a checking method to see
if the guid being passed in (regular 128 bit windows registry GUID) is
valid.
So far it seems to handle most errors thrown at it but today during a
test, a bracket "}" passed through the method as a valid guid so I
wanted to know if this expresion will stop invalid guids or did I miss
something?
__systemGUID is the string passed in.
if(!Regex.IsMatch(__systemGUID,
@"^([\w]{8}-[\w]{4}-[\w]{4}-[\w]{4}-[\w]{12})"))
Thanks.
if the guid being passed in (regular 128 bit windows registry GUID) is
valid.
So far it seems to handle most errors thrown at it but today during a
test, a bracket "}" passed through the method as a valid guid so I
wanted to know if this expresion will stop invalid guids or did I miss
something?
__systemGUID is the string passed in.
if(!Regex.IsMatch(__systemGUID,
@"^([\w]{8}-[\w]{4}-[\w]{4}-[\w]{4}-[\w]{12})"))
Thanks.