Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
bgarland
Contributor III

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?

Tags (1)
Community Browser