1

Closed

Question class constructor bug

description

Hi,
Line 45 currently reads:
if (domain.Length ==0 || domain.Length>255 || !Regex.IsMatch(domain, @"^[a-z|A-Z|0-9|-|_]{1,63}(\.[a-z|A-Z|0-9|-|_]{1,63})+$")) I haven't written many regexps recently, but this doesn't seems to work for domains with "-" in them.
if (domain.Length ==0 || domain.Length>255 || !Regex.IsMatch(domain, @"^[a-z|A-Z|0-9|\-|_]{1,63}(\.[a-z|A-Z|0-9|\-|_]{1,63})+$")) works fine. So I'm guessing I'm right in saying this is a bug?
A
Closed Aug 10, 2011 at 9:44 AM by
Seems to be working as supposed to

comments

TuxyQ wrote Jun 24, 2011 at 2:14 PM

I'll look into it, could quite possibly be right.

TuxyQ wrote Aug 10, 2011 at 9:44 AM

I've tested this and the current Regex seems to match allready.
some regex engines requires escaping of special characters, others don't, seems .net uses one of the latter kind.