Advertisement
Guest User

Untitled

a guest
Aug 12th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.15 KB | None | 0 0
  1. const phone = "+79009999999"
  2. const formatedPhone = phone.replace(/(\d{1})(\d{3})(\d{3})(\d{2})(\d{2})/, '$1 ($2) $3-$4-$5');
  3. // -> "+7 (900) 999 99 99"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement