Skip to main content
Solved

regex email validation doesn't work

  • May 27, 2023
  • 7 replies
  • 44 views

Forum|alt.badge.img+7

Hi,

I'm trying to validate customer's mails, to send them automated mails.

I created a column validating another Email column in my relevant table, but the formula shows me that the mail doesn't match the regex, even though I know it's a working mail.

the formula is: 

IF((REGEX_MATCH({Email}, "[A-z0-9.+-_]+@[A-z0-9-]+\\.[A-z]+/g")),"Yes","No")
 
I've basically took it from here:
 
 
the example is this:
 
Can someone please assist?

Best answer by ScottWorld

Their example has a typo in it, which you should report to Airtable using the thumbs down button at the bottom of the article.

Here is the working formula:

REGEX_MATCH( {Email address}, "(\W|^)[\w.\\-]{0,25}@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}(\W|$)")

7 replies

kuovonne
Forum|alt.badge.img+29
  • Brainy
  • 6009 replies
  • May 28, 2023

That doesn't look like the regex in the support page you cite. It also doesn't look like an Airtable RE2 regex pattern because it ends in /g.


Forum|alt.badge.img+7
  • Author
  • Inspiring
  • 11 replies
  • May 28, 2023

That doesn't look like the regex in the support page you cite. It also doesn't look like an Airtable RE2 regex pattern because it ends in /g.


You are right. it was another Regex I tried.

tried also the one in the link, still didn't work("(\W|^)[\w.\\-]{0,25}@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}(\W|$)")

This is the example that  appears in the link:

REGEX\_MATCH( {Email address}, "(\W|^)[\w.\\-]{0,25}@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}(\W|$)")


ScottWorld
Forum|alt.badge.img+35
  • Genius
  • 9770 replies
  • Answer
  • May 28, 2023

Their example has a typo in it, which you should report to Airtable using the thumbs down button at the bottom of the article.

Here is the working formula:

REGEX_MATCH( {Email address}, "(\W|^)[\w.\\-]{0,25}@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}(\W|$)")


Forum|alt.badge.img+7
  • Author
  • Inspiring
  • 11 replies
  • May 28, 2023

Still doesn't work. 😕😕


ScottWorld
Forum|alt.badge.img+35
  • Genius
  • 9770 replies
  • May 28, 2023

It works just fine for me. 


kuovonne
Forum|alt.badge.img+29
  • Brainy
  • 6009 replies
  • May 29, 2023

What is your field type? Is it a lookup field? If so, you will need to convert it to a text string.

Can you include screen shots?


Forum|alt.badge.img+7
  • Author
  • Inspiring
  • 11 replies
  • May 29, 2023

Thank you guys! 

It worked. Found other typoes in my formula, and after implementing the formula @ScottWorld sent, it worked perfectly.