Hello,
I want to add a validation that the user must enter the email like 'AB123@domain.com'. I checked IsMatch references but i am not able to customize the entire email ID in the required manner. Can anyone please help for the same?
Also is there any instant expression generator available based on the input given? So that we can just tell the example and it will convert it in to the expression?
Many Thanks,
Akshay
Solved! Go to Solution.
Hello @mdevaney,
I got a very simple solution. Used below code.
If(IsMatch(TextInput2.Text, "[A-Za-z]{2}[0-9]{3}@domain.com"), "Valid", "Not Valid")
This is working as expected. But still you can share any best workaround. 🙂
Thanks,
Akshay
Your most recent posts have helped me to understand you also wanted to validate the numbers as well. That's one reason why it wasn't working as expected.
The regular expression will work fine. However, here's another way to write it that you don't have to learn regular expressions for.
If(
IsMatch(
TextInput2.Text,
Match.Letter & Match.Letter & Match.Digit & Match.Digit & Match.Digit & "@domain.com"
),
"Valid",
"Not Valid"
)
Please Accept both of our solutions: yours and mine as the answer here 🙂
You can check for a valid email like this:
IsMatch("AB123@domain.com", Match.Email)
---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."
Hello @mdevaney,
Actually i can validate an email using Match.Email function but i specifically need a validation to check the email in this format.
AB123@domain.com
More details as below.
First 2 Letters = AB
Then 3 Number = 123
The @ Symbol = @
Then domain name = domain.com
Hence the complete email ID would be AB123@Domain.com.
Thanks,
Akshay
Adding a few more validations like this will do the trick.
With(
{varEmail: "AB123@domain.com"},
Left(varEmail,2)="AB"
And Right(varEmail, 9)="domain.com"
And IsMatch(varEmail, Match.Email)
)
---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."
Hello @mdevaney,
I am trying to corelate it but not getting clearly.
Lets have one example. I have added TextInput2. If the Email is in the correct format then then the fill property should be while else green.
How to apply your given formula to it?
Thanks,
Akshay
Hello @mdevaney,
I got a very simple solution. Used below code.
If(IsMatch(TextInput2.Text, "[A-Za-z]{2}[0-9]{3}@domain.com"), "Valid", "Not Valid")
This is working as expected. But still you can share any best workaround. 🙂
Thanks,
Akshay
Your most recent posts have helped me to understand you also wanted to validate the numbers as well. That's one reason why it wasn't working as expected.
The regular expression will work fine. However, here's another way to write it that you don't have to learn regular expressions for.
If(
IsMatch(
TextInput2.Text,
Match.Letter & Match.Letter & Match.Digit & Match.Digit & Match.Digit & "@domain.com"
),
"Valid",
"Not Valid"
)
Please Accept both of our solutions: yours and mine as the answer here 🙂
Yes you are right the below code also will give the same result.
If(
IsMatch(
TextInput2.Text,
Match.Letter & Match.Letter & Match.Digit & Match.Digit & Match.Digit & "@domain.com"
),
"Valid",
"Not Valid"
)
Anyways, i am accepting both as solutions now 🙂. Still Many Thanks for your help.
User | Count |
---|---|
234 | |
110 | |
94 | |
59 | |
29 |
User | Count |
---|---|
289 | |
129 | |
104 | |
62 | |
57 |