troubleshooting Question

Help with Regex

Avatar of Michael
Michael asked on
Regular Expressions
4 Comments1 Solution17 ViewsLast Modified:

HI im trying to extract this url from an email using regex. My Regex string is 


/href=\"(https:\/\/www.linkedin.com\/e\/v2\/S+)/g


The string I'm looking for is:

href="https://www.linkedin.com/e/v2?e=4mwol-kx0cskhe-b2&lipi=urn%3Ali%3Apage%3Aemail_email_jobs_new_applicant_01%3BQXTCX4qcT7OfUsLaH3cuLA%3D%3D&t=plh&midToken=AQG80kTcNtwiXA&ek=email_jobs_new_applicant_01&li=0&m=email_jobs_new_applicant&ts=job_posting_download_resume&urlhash=dt4R&url=https%3A%2F%2Fwww%2Elinkedin%2Ecom%2Ftalent%2Fapi%2FtalentResumes%3FapplicationId%3D8549340446%26tokenId%3D1524127108%26checkSum%3DAQGg2sABm2nopxlP8EhnWBw3EtcLXz1U"


My issue is the string href="https://www.linkedin.com/e/v2 is used a few times in the email so the regex is flawed. It matches up to three times


I have some options to consider, Can i have regex stop after it finds 1 match? Or can i add that it must contain the string download_resume? 


Language is Javascript


thanks in advance

ASKER CERTIFIED SOLUTION
Michael

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 4 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros