title: How to access to only the value of the match RegExp,and not also name, in javascript?
body: <p>I am doing a RegExp in javascript and I need to be able to access the value returned to a matching run, I'm using the online tool of Regexp and I saw that this matching works, I also found a &quot;code generator&quot; related to the online tool that produces a code that shows me how to return the values. I also report the values that are returned in the console, I wanted to know, how can I retrieve only the group &quot;value&quot; of these attributes without the name?</p>
  <p>RegExp</p>
  <pre><code>const regex = /\[(\w{1,10}\^\w{1,10}\^\^\w{1,10}|\w{1,10}\s\w{1,10}\s\w{1,10}\s\w{1,10}\s\w{1,10}\^\w{1,10}\s\w{1,10}\s\w{1,10}\s\w{1,10}\s\w{1,10}\^\^)\]/gm;
  </code></pre>
  <p>String to match</p>
  <pre><code>const str = `
  
  </code></pre>
  <p>code that is generated automatically by the tool Online Regexp:</p>
  <pre><code>while ((m = regex.exec(str)) !== null) {
      // This is necessary to avoid infinite loops with zero-width matches
      if (m.index === regex.lastIndex) {
          regex.lastIndex++;
      }
      
      // The result can be accessed through the `m`-variable.
     // The result can be accessed through the `m`-variable.
      m.forEach((match, groupIndex) =&gt; {
          console.log(`Found match, group ${groupIndex}: ${match}`);
      });
  }
  </code></pre>