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

90
Views
regex string @[name of some thing](stringId)

I have a text with string content and a tag. I want to split the text into an array. I tried many ways but got some bugs @@

Input:

"This is a text with a @[name of tag](tagId). This is another @[name of another tag](tagId)"

Output:

array = ["This is a text with a ", "@[name of tag](tagId)", ". This is another " , "@[name of another tag](tagId)"]

The tag always has @[ at begin, ) at the end and ]( at between,

I tried

const str = "This is a text with a @[name of tag](tagId). This is another @[name of another tag](tagId)"
const result = str.split(/[@[)]/);
console.log(result);

But that has many issues like "", " " or missing @[ in result

Thanks for all help

about 4 years ago · Santiago Gelvez
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!