I use the following expression to validate email addresses (I found it on internet somewhere, so don't blame me if it's totally wrong :-) ):
^((?:(?:(?:[a-zA-Z0-9_][.-+]?)*)[a-zA-Z0-9_][.-+]?)*)\@((?:(?:(?:[a-zA-Z0-9][.-_]?){0,62})[a-zA-Z0-9])+).([a-zA-Z0-9]{2,6})$
It works fine in most cases, but for some reason adding a space somewhere in the email address makes the IsMatch method very slow. It seems that the computation time grows with the position of the space in the email address. The following not valid email addresses illustrate the problem.
test@aweb serversomewhereintheworld.com (slow)
test@awebserversomewhere intheworld.com (very slow)
What's wrong with the regular expression that is used to validate the email addresses?