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

233
Views
Find string in string and return a substring (Zapier)

I have a string like "localhost,GEWTESTID" or "GEWTESTID,localhost,somethingelse" etc.

Now I would like as an output = GEWTESTID

The string is always starts with "GEW" and 6 chars are following.

So what I need:

  1. Find GEW
  2. Find the next 6 chars (after GEW) (or go to next seperator = ",")
  3. Output (1+2) = GEWTESTID

This I need working for Zapier Javascript code.

Thank you very much!

about 4 years ago · Santiago Gelvez
1 answers
Answer question

0

We can try using string match() here with the pattern \bGEW.{0,6}\b:

var inputs = ["localhost,GEWTESTID", "GEWTESTID,localhost,somethingelse"];
inputs.forEach(x => console.log(x + " => " + x.match(/\bGEW.{0,6}\b/)[0]));

To extract the Zapier substring, use:

var input = "localhost,GEWTESTID";
var zapier = input.match(/\bGEW.{0,6}\b/)[0];
about 4 years ago · Santiago Gelvez 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!