Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

217
Visualizações
Text expander paste function to format a phone number

I am trying to create a Text Expander snippet to speed up a workflow. I want to copy a number in this format: +12345678910 and be able to past this it like this: (234) 567-8910 and make the font bold.

The closest script I've found is:

var s2 = (""+TextExpander.pasteboardText).replace(/\D/g, '');
var m = s2.match(/^(\d{3})(\d{3})(\d{4})$/);
if(m) `(${m[1]}) ${m[2]}-${m[3]}`;
else "";

This allows me to copy the "2345678910" portion of the data and and have it pasted as (234) 567-8910. Any suggestions would be super helpful, I'm interested in learning.

thanks

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Add the +1 to your regex, but don't include it in a group: /^\+1(\d{3})(\d{3})(\d{4})$/

regexer can be super helpful for flushing these issues out~

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda