Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

RegEx Question

I'm using this RegEx in my script to test if a phone number field actually contains a valid phone number:

^(?:\([2-9]\d{2}\)\ ?|[2-9]\d{2}(?:\-?|\ ?))[2-9]\d{2}[- ]?\d{4}$

This works fine. But it turns out that my source data sometimes has extensions tacked on to the end of the phone number in the form of an underscore and three or four digits:  _123 or _1234

Any RegEx experts out there who know how to add these optional extensions to my RegEx?

0 Replies