Here are some that we use:
US 10 or 11 digits
\b[0-9]{10,11}\b
\d[10,11]
[(]?\d{3}[-.)]?[ ]?\d{3}[-.]?\d{4}\b
[(]?\d{3}[)]?\s?-?\s?\d{3}\s?-?\s?\d{4}
Internataional
^\s*(?:\+?(\d{1,3}))?([-. (]*(\d{3})[-. )]*)?((\d{3})[-. ]*(\d{2,4})(?:[-.x ]*(\d+))?)\s*$
^\s*((0044[ ]?|0)[ ]?20[ ]?[7,8]{1}?[ ]?[1-9]{1}[0-9]{2}[ ]?[0-9]{4})|((0044[ ]?|0[1-8]{1})[0-9]{1,2}[ ]?[1-9]{1}[0-9]{2}[ ]?([0-9]{6}|[0-9]{5}|[0-9]{4}))|(0[1-8]{1}[0-9]{3}[ ]?[1-9]{1}[0-9]{2}[ ]?[0-9]{2,3})|(0800[ ]?([1-9]{3}[ ]?[1-9]{4}|[1-9]{6}|[1-9]{4}))|(09[0-9]{1}[ ]?[0-9]{1}[ ]?([1-9]{4}|[1-9]{6}|[1-9]{3}[ ]?[1-9]{4}))\s*$
^([+]\d{3})?\s?(\d{3}\s?){2}\d{3}$
Personally, I prefer regexr.com and search the community.
------------------------------
Robert Wakefield-Carl
ttec Digital
Sr. Director - Innovation Architects
Robert.WC@ttecdigital.comhttps://www.ttecDigital.comhttps://RobertWC.Blogspot.com------------------------------
Original Message:
Sent: 11-29-2024 15:24
From: Marco Villaseñor
Subject: Regex External trunk Address Transformation
Hi Daniele, you may need to set some parts as optional, so you always get a match.
I think these expressions will work for you:
- ^(sip[s]?:|tel:)?(\+)?(39)(\d+)(@.*)? with format $1$4$5
- ^(sip[s]?:|tel:)?(\+)?(\d{6,})(@.*)? with format $1\x30$3$4
------------------------------
Marco Villaseñor
Interastar
Original Message:
Sent: 11-29-2024 05:19
From: Daniele Di Giovanna
Subject: Regex External trunk Address Transformation
Hi Nick,
same problem.
On regex101.com all solutions work correctly but not on Genesys.
I can't find a solution.
Kind Regards,
Daniele
------------------------------
Daniele Di Giovanna
Senior Consultant
Original Message:
Sent: 11-28-2024 15:19
From: Nick Tait
Subject: Regex External trunk Address Transformation
Hi Daniele.
I happened to notice that none of the examples in the Genesys Cloud documentation (e.g. here and here) use "\d" to represent a digit. I wonder if the regex engine doesn't support "\d"?
Have you tried using "[0-9]" (or even ".") instead of "\d", to see if that solves the problem?
Nick.
------------------------------
Nick Tait
Genesys Consultant
Original Message:
Sent: 11-26-2024 07:52
From: Daniele Di Giovanna
Subject: Regex External trunk Address Transformation
Hi Simon,
I tried but it doesn't work.
It seems that the regex condition is not recognized.
------------------------------
Daniele Di Giovanna
Senior Consultant
Original Message:
Sent: 11-26-2024 07:11
From: Simon Brown
Subject: Regex External trunk Address Transformation
Change format to ${1}0${2}
------------------------------
Simon Brown
Mr
Original Message:
Sent: 11-26-2024 05:15
From: Daniele Di Giovanna
Subject: Regex External trunk Address Transformation
Hi,
I'd like to transform called address on outbound calls using regex on the external trunk configuration.
If there is +39 in front of the number, I need to delete it.
After that, if the phone number is longer than 6 characters, I need to put "0" in front of the number.
I configured the regex:
^(sip:|tel:|sip[s]:)(\+39)(.*) $1$3 --> to delete the +39, it works correctly
^(sip:|tel:|sip[s]:)(\d{6,})$ $1\x30$2 --> to add 0 (zero), but it doesn't work.
Called +393405438365 or 3405438365 the call comes out as: tel:3405438365 --> KO
Called 3456 or +393456 the call comes out as: tel:3456 --> OK
Using regex101.com, It seems to be working fine, but on GenesysCloud doesn't work.
Can you please help me to configure it?
Kind Regards,
Daniele
#ArchitectureandDesign
#Implementation
#Outbound
#SIP/VoIP
#Telephony
------------------------------
Daniele Di Giovanna
Senior Consultant
------------------------------