Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

234
Views
Expresión regular para extraer cadenas entre paréntesis angulares con exactamente un carácter @ en el medio

¿Alguien tiene una idea de cómo hacer coincidir algo como

 <t@t.com>

Probé esta expresión regular

 \<(.?*)\>

pero esto también coincide con <sddsds> . Quiero que coincida donde dentro de <> hay un correo electrónico con el signo @ .

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

Puedes usar

 <([^<>@]+@[^<>@]+)>

Vea la demostración de expresiones regulares . Detalles :

  • < - un < carácter
  • ([^<>@]+@[^<>@]+) - Grupo 1: uno o más caracteres distintos de < , > y @ , un carácter @ y luego uno o más caracteres distintos de < , > y @
  • > - un > carácter.

Vea la demostración de PHP :

 $str = "<t@t.com>\n<tatacom>\n<t@ata@com>"; $re = '/<([^<>@]+@[^<>@]+)>/'; if (preg_match_all($re, $str, $matches)) { print_r($matches[1]); } // => Array( [0] => t@t.com )
over 4 years ago · Santiago Trujillo Report

0

Puedes usar esto:

$regex = '/^\w+([.-]?\w+)*@\w+([.-]?\w+)*(\.\w{2,3})+$/'

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!