Atozed Forums
E-Mail Validate?? - Printable Version

+- Atozed Forums (https://www.atozed.com/forums)
+-- Forum: Atozed Software Products (https://www.atozed.com/forums/forum-1.html)
+--- Forum: IntraWeb (https://www.atozed.com/forums/forum-3.html)
+---- Forum: English (https://www.atozed.com/forums/forum-16.html)
+----- Forum: IntraWeb General Discussion (https://www.atozed.com/forums/forum-4.html)
+----- Thread: E-Mail Validate?? (/thread-1384.html)



E-Mail Validate?? - ShaneStump - 11-15-2019

Howdy All!

I have an e-mail regexp that I have been using that validates most e-mail addresses.

I have tried it (and many others I have seen in stackoverflow) and none of them validate a test e-mail account I have been given by Viator. I have tried some of the online validators and they work!

So my question is does anyone have a C++ or Delphi regexp that can validate the following e-mail account and return True.

MSG-8b17fa92-7b35-4fdb-9f18-f8a69252e019+BR-999999999@expmessaging.tripadvisor.com

Thanks in advance,

Shane


RE: E-Mail Validate?? - cprmlao@hotmail.com - 11-16-2019

This is not a IW question.
But you can try:


Code:
var input, s:string;
    valid_email:boolean;
begin
    s := '^(([^<>()\[\]\.,;:\s@\"]+(\.[^<>()\[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$';
   input:='MSG-8b17fa92-7b35-4fdb-9f18-f8a69252e019+BR-999999999@expmessaging.tripadvisor.com';
   valid_email:=TRegEx.IsMatch(input, s, [roIgnoreCase])
end;



RE: E-Mail Validate?? - ShaneStump - 11-16-2019

(11-16-2019, 04:07 PM)cprmlao@hotmail.com Wrote: This is not a IW question.
But you can try:
var input, sConfusedtring;
    valid_email:boolean;
begin
    s := '^(([^<>()\[\]\.,;:\s@\"]+(\.[^<>()\[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$';
   input:='MSG-8b17fa92-7b35-4fdb-9f18-f8a69252e019+BR-999999999@expmessaging.tripadvisor.com';
   valid_email:=TRegEx.IsMatch(input, s, [roIgnoreCase])
end;
Thanks -  I will give that mask a try!

As far as it not being an IW question, maybe not directly, but indirectly I would say it is for a lot of people. All the IW apps I write send e-mail in one way or another.

All the best,

Shane

P.S. Ok - I tried the mask and it works for the e-mail address I gave but it doesn't work for simpler e-mail addresses. I am looking for a mask that will validate as many e-mail addresses as possible including the aforementioned one.


RE: E-Mail Validate?? - cprmlao@hotmail.com - 11-16-2019

Ok please try stackoverflow and you can have better support


RE: E-Mail Validate?? - ShaneStump - 11-16-2019

(11-16-2019, 04:30 PM)cprmlao@hotmail.com Wrote: Ok please try stackoverflow and you can have better support

Thanks - please don't take any insult from my post. 

I appreciated the help and I have tried several of the solutions from stackflow with similar results.

It seems the only solution I can find it to actually use a mail account.

But I will post a followup if I find a solution as it may help others.

All the best,

Shane


RE: E-Mail Validate?? - cprmlao@hotmail.com - 11-16-2019

You can use your mask working for simple email and the mask i posted. Make an "or" with the two tests.