|
|
Browse by Tags
All Tags » lookahead » dotNet
-
docdawson:
^(\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*){n,20}$
Doesn't this just match n to 20 e-mail addresses? I understand carlosaml wants addresses with no more than 20 characters.
The shortest possible address that will match the pattern above has 5 characters (a@b.c).
To check for 5 to 20 characters one would have to use a ...
-
This pattern might do what you need.
(?ms)(?<=^(TO|INFO)\s).*?(?=\s+^(?:INFO|GR)\s)
It will only work reliably if there are no two other lines starting with TO, INFO or GR in the message body, i.e. after the first GR.
It will return one or two matches, depending on the presence of the INFO part. You will have to split those ...
|
|
|