Forum Discussion
Mike_Finney_119
Nimbostratus
Sep 06, 2013iRule 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://...
Kevin_Stewart
Employee
Sep 06, 2013Do you need regex for this?
set num1 "123.456.7890"
set num2 "123-456-7890"
set num3 "123 456 7890"
set num4 "(123) 456-7890"
log local0. [string map {"." "" " " "" "-" "" "(" "" ")" ""} $num1]
log local0. [string map {"." "" " " "" "-" "" "(" "" ")" ""} $num2]
log local0. [string map {"." "" " " "" "-" "" "(" "" ")" ""} $num3]
log local0. [string map {"." "" " " "" "-" "" "(" "" ")" ""} $num4]
Output:
1234567890
1234567890
1234567890
1234567890
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects