Regular expression to get country code out of a complete phone number

  • Thread starter Thread starter baljit55
  • Start date Start date
B

baljit55

Guest
My phone numbers are in +1-123-456-7890 format and I need to attribute map it to the country code only.

Example:

Input : +1-123-456-7890 Output : 1

Input : +44-123-456-7890 Output : 44

I am using expression as below but it is not working.

'Replace([telephoneNumber], , "\\+(?<isdCode>\\d*)(?<phoneNumber>\\d{10})", , "${isdCode}", , )'

Continue reading...
 
Back
Top