MATCh_REGEX is not working properly, and sending all records

Hi Gurus,

I have used the below string in Validation, but upon running all my emails are directed to fail schema even though it matches pattern as I understand.

Requirement: Email ID: russell_klein@mbctckrg.com

String in Validation:

match_regex(QT_LOOKUP.EMAIL,’^[-a-z A-Z]+[0-9-_%#a-z A-Z](.[a-zA-Z]+)[0-9]@[a-zA-Z]+(.[a-z A-Z])+$’,NULL) = 1


Parijatam (BOB member since 2016-09-08)

Go to:

https://regex101.com/

Put in your regex string.

Put in your match string.

It says no match, your Regex string needs correction, not the function.

  • Ernie

eepjr24 :us: (BOB member since 2005-09-16)

Thanks for replying, I have visited the site you mentioned but not able to get clue on how to correct. So requesting you if you can help in creating correction regex function


Parijatam (BOB member since 2016-09-08)

I would probably go with:

^([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5})$

If you are obsessive or have some REALLY corner cases, this should cover everything:

(?:[a-z0-9!#$%&'*+\/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+\/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])

Tip: Regex is supremely well documented on the web, you can find examples of just about anything with a quick google search.

  • Ernie

eepjr24 :us: (BOB member since 2005-09-16)

Hi,

Thanks for help, however I need you help for validation phone numbers as well. My regex string works perfectly for all phone numbers perfectly but fails for simple phone number.

String:^[+(]?\d{1,4}[- .]?(( |(| (|-)?\d{1,4}( |)|) |-)?)?(\d{0,2} )?\d{2,4}[- .]?\d{2,4}[- .]?\d{0,4}[- .]?\d{0,4}?(Ext|ext|EXT)?([- .]+)?\d{0,4}?$

Input String: 8613814171095

It passes for group 1 & fails in 2…will be visible when you will run regex debugger.

Some how it is not even starting for first digit 8…I don’t understand why?


Parijatam (BOB member since 2016-09-08)

http://lmgtfy.com/?q=regex+library+US+telephone+number

  • Ernie

eepjr24 :us: (BOB member since 2005-09-16)