Atozed Forums

Full Version: E-Mail Validate??
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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
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;
(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.
Ok please try stackoverflow and you can have better support
(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
You can use your mask working for simple email and the mask i posted. Make an "or" with the two tests.