Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

213
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda