Sample to find email adress with Match Regex

Is the limit of 8 empirical ? Empirical too often means, we will have to fix the code when we find a new exception to the cases we know.

We just know that it is 2 or more…

The longest TLD currently in existence is 24 characters long, and subject to change. The maximum TLD length specified by RFC 1034 is 63 octets.


From One to X,
yes there are always some new exotics and when you checked in 24 than comes one with 25,
but back to theme regex,
the job destination is to find qualified email-adresses.

In some use cases the job-destination-strategy is to find all email-adresses
in any bigger wild text (wild means, any text what can have any contents, contents can not known before).
And it is wished to find realy all possible email-adresses
and it is accepted that sometimes the regex catched real hits and possible errors (no email only a char-sequence what looks like).
So you can define an extremely fuzzy rule that does not leave out any theoretically possible char-sequence that may be an email.

The greater the blur, the higher the number of misses.

The task is to individually define the ideal sharpness that is suitable for the individual application/useCase.

So you can only choose the individual balance between too sharp and too unsharp,
depending on whether you want to always only have qualified results or whether you want to tolerate the fact that some mistakes are made but no matter how small a suspicion remains unreported.