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

120
Views
Group first folder and the following files in Regex

I am trying to use regex to group the root folder of a package and to group the rest of the files in it.

I tried the following @package\/(.*)\/(\/*.+)$ with the test string @package/util/src/index.js: Regex

But instead of grouping util/src and index.js I want to group for util and src/index.js. I thought the / between the groups in my regex would match on the first /. What do I miss?

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

0

You might write the pattern like this to not cross the first / and then capture the rest of the line using (.+)$ without optional repeating \/*

@package\/([^\/]+)\/(.+)$

Regex demo

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!