I need to format my telephone numbers in a specific way. Unfortunately business rules prohibit me from doing this up front. (separate input boxes etc..)
The format needs to be +1-xxx-xxx-xxxx where the "+1" is constant. (We don't do business internationally)
Here is my regex pattern to test the input:
"\\D*([2-9]\\d{2})(\\D*)([2-9]\\d{2})(\\D*)(\\d{4})\\D*"
(which I stole from somewhere else)
Then I perform a regex.Replace() like so:
regex.Replace(telephoneNumber, "+1-$1-$3-$5"); **THIS IS WHERE IT BLOWS UP**
If my telephone number already has the "+1" in the string, it prepends another so that I get +1-+1-xxx-xxx-xxxx
Can someone please help?

(+1-)?at the front of your regex to accomodate for the telephone numbers that already have the +1...