I need to find a regular expression that validates an email address in the simplest form and the email address should not exceed 250 characters. Here is what I came up with so far.
(?=.{1,250}$)(.+)@(.+){2,}\.(.+){2,}
The problem is this expression works for small email lengths sets. i.e. If I put 10 instead of 250 it will work. If I tested the above expression against large sample it will throw catastrophic backtracking exception. https://regex101.com/r/Dv2j2U/1. Can someone please help me solving this?