1586
Views
8
Comments
how to validate .com in email
Question

hi friends,

                emailaddressvaliate() is validating only @ symbol.how to validate .com domain in outystems

2021-02-18 12-29-06
António Pereira
Champion

Hi Karthik,

What do you want to evaluate? if the email has the ".com" or if the email exists?


Regards,

António Pereira

2022-07-07 18-45-50
Niels Favreau

You can use regex. And search some regex email validations on the internet.

2020-04-23 11-14-57
Nhorwin John Villano

Niels Favreau wrote:

You can use regex. And search some regex email validations on the internet.


Thanks Niels,

I use Regex email validations and it works

Regards,

Nhorwin

UserImage.jpg
sai p

Nhorwin John Villano wrote:

Niels Favreau wrote:

You can use regex. And search some regex email validations on the internet.


Thanks Niels,

I use Regex email validations and it works

Regards,

Nhorwin


Hi John,

how did you use Regex for email validations can you share screenshots or sample code.

Thanks



2012-03-16 12-21-09
João Rosado
Staff

Also, the email validate functions validates a lot more than the @. But acording to the email addresses spec the .com is not a mandatory part (even though it is not recommended to use email like those outside intranets) so it accepts that to comply with the specification.


Theres more topics regarding this, but like Niels said if you want different validation rules you should create your own validation function using regexs. Careful that many regex that you find online many not be complete enough or be too slow due to their complexity.


Regards,

João Rosado

UserImage.jpg
sai p

Hi John,

how did you use Regex for email validations can you share screenshots or sample code.

Thanks

2020-02-10 06-34-00
Jacques Lalancette

You would need to adapt the regex for your needs, but I used this for my example (but it allows any extension):

https://stackoverflow.com/questions/46155/how-to-validate-an-email-address-in-javascript


Then you'll create an action like this:

The JavaScript part will have an input (the email) and an output (the result - valid).


You should get results like this:

For more info on using JavaScript in your application, you can check out this module.

https://www.outsystems.com/learn/courses/44/master-class-on-javascript-and-jquery/?LearningPathId=2

2020-09-21 08-42-47
Vincent Koning

For the people that want to have the regex to match email addresses. there are several available; I use the simple version as this is good enough for my use-case. If you have more rigorous requirements you could use the rfc 5322 compliant version. This one more resource intensive though.

Simple version:

\b[A-Z0-9][A-Z0-9._%+-]*@(?:[A-Z0-9-]+\.)+[A-Z]{2,}\b


RFC 5322 compliant:

\A[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*
@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\z

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.