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

221
Views
Extract href by regex

could you help out , i am am receiving an email and trying to extract the link from the text so that the match would be [https://development-client.test.app/users/reset-password?email=test.test%40inbox.testmail.app&code=98f192b1-5673-45b5-b498-d55a4ba3345]

I need to ignore the brackets and stop once code= value ends

This would match all the way including the bracket https:\/\/[^\s]+

about 4 years ago · Juan Pablo Isaza
3 answers
Answer question

0

Use

\[([^\]]+)\]

to find your match in capture group #1.

about 4 years ago · Juan Pablo Isaza Report

0

Not sure if this is your intention, if I understood you correctly then this option would work for matching any text in between a starting "[" and a closing "]":

const text =
  '[https://development-client.test.app/users/reset-password?email=test.test%40inbox.testmail.app&code=98f192b1-5673-45b5-b498-d55a4ba3345]';

console.log(text.match(/(?<=^\[).*(?=\]$)/)[0]);
// https://development-client.test.app/users/reset-password?email=test.test%40inbox.testmail.app&code=98f192b1-5673-45b5-b498-d55a4ba3345
about 4 years ago · Juan Pablo Isaza Report

0

You should exclude the closing (escaped) bracket together with the whitespaces:

https:\/\/[^\s^\]]+

You can check it here.

about 4 years ago · Juan Pablo Isaza 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!