My questions is why you have [?.]
That’s easy if you look at your expression split into parts like below in line 2 it requires 1 character from the set [a-z] , plus line 3 requires “+” (1 or more) from the next set ([a-z]+) so you require 2 before any period (or question mark)
I do not have the Email spec memorized and this is a complicated expression, maybe too complicated. Are trying to prevent invalid use of the period like … @. [email protected] ? I would do that separately. This is untested:
IF MATCH('^\.|\.$',Eml,Match:Regex) THEN ! No [email protected]
Message('Cannot begin or end with a period')
P=STRPOS('\.\.|\[email protected]|@\.',Eml) ! No .. [email protected] @.
IF P THEN
MESSAGE('Invalid Period at position ' & P & ': ' & SUB(Eml,P,2)
Maybe then your expression before the @ can be simpler.
I would suggest on your Window you add a TEXT control so you can work on the separate lines more easily (like my 1 to 9 above). PROP:LineCount and PROP:Line can be used to get the lines and concat into a single string.
In sets the hyphen should be first so [A-Z0-9-] as [-A-Z0-9]
Below worked for me, except it does not catch the … [email protected] that I would do separately. I added Underscore. Not sure why you have ? or . so changed [?.] to backslash-period. Is [email protected] with no .xx suffix valid?