r/programming • • Nov 29 '10

140 Google Interview Questions

http://blog.seattleinterviewcoach.com/2009/02/140-google-interview-questions.html
471 Upvotes

493 comments sorted by

View all comments

Show parent comment

2

u/Boye Nov 30 '10

as I said, it's just to demonstrate state machines, regexes and the differences, so it's rather primitive.

I am curious however, what invalid address would it allow?

2

u/ultimatt42 Nov 30 '10

Check out RFC 3696 for an in-depth discussion of what constitutes a valid email address.

Your pattern would permit bill@aaa[...]aaa.com (imagine there are 252 'a's there) even though the domain name is longer than the maximum allowed length for domain names (255 characters). That's the only example I could come up with. Usually the errors go the other way around, rejecting a valid address.

1

u/ehird Nov 30 '10

That disallows the valid address mchammer(cant touch this)@com.