I'm not sure why you've started with an expression full of control characters and other stuff, or even what that expression is supposed to mean. Maybe if you told us where you got it, or explained it, we could help you debug it. But otherwise, it's much simpler to throw it away and give you a simpler one.
You say you took it from this answer, but the string in that answer is 29 characters longer than the one you gave, so apparently you copy-pasted it wrong, or modified it after the fact in some way. At any rate, according to the question, that regexp is intended to validate email addresses against a domain, not to find all email addresses. It also seems to handle quoted (maybe even encoded?) names. The fact that it starts with ^
and ends with $
is a clear sign that it can't be used to find addresses in the middle of a string, but only to match the entire string. So, it's not what you want. You can't just pick up a regexp from one problem and hope it works for a vaguely-related problem without understanding what it's doing.
You complained that RocketDonkey's doesn't work for email with dots in it. That's true, and it also doesn't handle a few other characters that are valid in an address. You could go read the appropriate RFCs, but it's a lot faster to do a quick search online for pre-made regular expressions for email addresses.
You may want to see this question, which includes a link to a fully RFC-822-compliant regexp, and explains how to get an RFC-5322-compliant one if you need to.
But depending on your uses, you may want something simpler, which can be tweaked to match not-valid-but-working addresses, or not match valid-but-useless addresses, or match native-Unicode instead of IDN-mangled Unicode, or…
Here's the first one I found in a Google search:
regexp=re.compile(r'[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,6}', re.IGNORECASE)
Is it correct? At a glance, it looks like it should handle all and only valid email addresses that use DNS names, but that's not all valid addresses. Maybe you need to handle dotted-IP mail domains, or pre-Internet email addresses, or you want to be looser in some ways or stricter in others, or whatever. If so, you'd have to explain what exactly you want. But you should be able to go from here yourself: Try it on your test cases and see. If it isn't right, it's very simple to read, and should be easy to modify.