Forum Discussion

Mike_Finney_119's avatar
Mike_Finney_119
Icon for Nimbostratus rankNimbostratus
Sep 06, 2013

iRule regex to normalize phone numbers?

Been searching but no luck so far looking for a iRule with a regex or some other method to normalize phone numbers from AD for use to pass to an SMS gateway. I have adapted the method here: https://devcentral.f5.com/articles/one-time-passwords-via-an-sms-gateway-with-big-ip-access-policy-manager.UioetD99-jy for our local Multitech SMS gateway and it does work fine with "unformatted" phone numbers like xxxxxxxxxxx, but management is not keen on my changing everyone's mobile number to exclude those characters for readability. Basically, our AD has a mismatch of methods for phone numbers, some have dashes, some have spaces, some have parentheses around the area code, the EU numbers have dots instead of dashes, so xxx.xxx.xxxx. Has anyone tried this before? Any suggestions would be most welcomed as my iRule and regex -fu is not as strong as it should be. :)

 

16 Replies