I want to format bellow types into this phone number: +33 (0) 6 60 23 12 47
Types are:
Type-1:
- 0660231247
- 06.60.23.12.47
- 06-60-23-12-47
- 06/60/23/12/47
Type-2:
- 336 60 23 12 47
- 336 660231247
- 336 6.60.23.12.47
- 336 6-60-23-12-47
- 336 6/60/23/12/47
- 336 6 60 23 12 47
Type-3:
- +336 60 23 12 47
- +336 660231247
- +336 6.60.23.12.47
- +336 6-60-23-12-47
- +336 6/60/23/12/47
- +336 6 60 23 12 47
I use this regex for Type-1 and I need simplier.
console.log((/^((\+|00)33|0) *([1-9])([s-|,|.\/]*[0-9]{2}){1}([s-|,|.\/]*[0-9]{2}){1}([s-|,|.\/]*[0-9]{2}){1}([s-|,|.\/]*[0-9]{2}){1}/).exec('0660231247'));