title: JS - Loop with multi Regex and insert in DataBase
body: <p>hello I have a text document in which I would like to retrieve successive elements at each loop with regex (name, image, url, date) in order to save these data in a database &quot;INSERT INTO event (name, image, url, date) VALUES ('name1', 'image1', 'url1', 'date1')&quot;</p>
  <ul>
  <li>I managed to find the regex but I only manage to make a loop with 1 element at a time (either name, either image, either url or date). Each loop, i want to retreive all element for n°1 and insert in DB, after for n°2 and insert in DB, after for 3....</li>
  </ul>
  <p><a href="https://regex101.com/r/WW84R8/2" rel="nofollow noreferrer">https://regex101.com/r/WW84R8/2</a>
  i want &quot;group 1, group 2, group 3, group 4&quot;</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code> const regexp = RegExp('","name":"(.+?)","__isS|"image":{"uri":"(.+?)"|"eventUrl":"(.+?)"|"start_timestamp":(.+?),','g');
  const matches = str.toString().matchAll(regexp);
  
  for (const match of matches) {
    console.log(`NAME: ${match[0]}`);
    console.log(` -IMAGE:  ${match[1]}`);
   console.log(` -URL: ${match[2]}`);
    console.log(` - DATE: ${match[3]}`);
  }</code></pre>
  </div>
  </div>
  </p>
  <p>thanks for your help</p>