so i want to detect email with some specific conditions
- start with letter or number [0-9a-zA-Z]
- before the @ it have to be also a letter or a number [0-9a-zA-Z]
- the email can contain a point in the middle of it but can't contain more than 1 point for example [email protected] is correct but [email protected] is not correct
- condition the email have to contain 6 minimum until 30 characters maximum
emailText='[email protected] [email protected]'
emailRegex=re.compile(r'[^.][0-9a-z]+[\.]?[0-9a-z][email protected]',re.I)
matchEmail=emailRegex.findall(emailText)
print(matchEmail)
I expected that it will detect only the 2nd email [email protected] but it detected also a part of the 1st email [email protected]