can you please explain to me what is going on here?
Get hold of the first (or maybe the second, I know it isn't in the third) edition of "Mastering Regular Expressions". This works through the RFC defining valid email addresses, and builds the regex needed.