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

166
Views
Replace BB code with hyperlinks for ALL occurrences

I have this replace code to parse BB code and convert links to clickable hyperlinks. This works for one link, however if there is more than one link in the string, it merges them together in one long link, hyperlinking all text in between. I thought the [g] flag accounted for this, but doesn't appear to work.

about = about.replace(/\[url=([^\s\]]+)\s*\](.*(?=\[\/url\]))\[\/url\]/g, '<a href="$1" target="_blank">$2</a>')
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I worked it out with the following:

about = about.replace(/\[url=([^\]]+)\](.*?)\[\/url\]/gi, "<a href=\"$1\" target=\"_blank\">$2</a>")

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!