Nice work. Personally I will still use the raw regex rather than the method calls to build the regular expression. As another commenter pointed out, the example regex is complex than it should be. It can be reduced to:
pat = re.compile(r'^ \w+ @ [A-Za-z]\w* \. \w+ $', re.X)
if pat.match('r@acnt.me'):
print "woot"
I won't bother explaining this regex(too simple). However, if it were something complex, I would put inline comments: pat = re.compile(r'''^ \w+ # rahul
@
[A-Za-z]\w* # thoughtnirvana
\.
\w+ # com
$''',
re.X)
Notes about the example regex: var regEx = {(?:^)[A-Za-z]([A-Za-z]+|(?:\d+))(@{1,1})[A-Za-z]+(.{1,1})[A-Za-z]+(?:$)}
(?:^), (?:$) - This is the same as simply using ^. It isn't captured by default so there isn't a need to mark it non-capturing.([A-Za-z]+|(?:\d+)) - What's going on here? You have a capturing group and within that capturing group, you have the or part marked as non capturing. What's the intent?
(@{1,1}) - @{1,1} is the same as @. Also, why are you capturing it? I think you are using parens for making the regex readable. You should use the IgnorePatternWhitespace instead http://msdn.microsoft.com/en-us/library/yd1hzczs.aspx