I have this regular expression for valid email addresses which works well: ^(?=[\w\s])\s*[-+.'\w]+@[-.\w]+\.[-.\w]{2,}\s*$
However, users are sometimes entering an address like "john@gmail.co". I could exclude "co" from my regex, but I still want to allow "john@example.co.uk", see here.
I looked at this post but I don't know how to include that in the part [-.\w]{2,}
of my current expression.
How can I alter my regular expression to disallow ".co" at the end of an email address?