title: Jmeter - Accessing Regex Array Variables In Beanshell
body: <p>I have problems picking up variables set by the Regular Expression
  Extractor in a Beanshell.</p>
  
  <ol>
  <li>I have an HTTP Request sampler which returns a list of 50 numbers in random form (4, 2, 1, 3....50, 45) which I have extracted via regEx.</li>
  <li>Now I want to get each and every numbers in a variable so I used again regEx with expression (.+?)(,) on JMeter variable from step# 1 above.</li>
  <li>I have problem here at this step when I am using BeanShell to access these values </li>
  </ol>
  
  <p>Wasn't very sure I used below:</p>
  
  <pre><code>long var1 = Integer.parseInt(vars.get("Number_i"));
  print("Value of var1: " +var1);
  </code></pre>
  
  <p>Practically I want to do this: </p>
  
  <pre><code>for (i=0; i&lt;50; i++) {
    if (var1==1) {
      do this
    }
  }
  </code></pre>
  
  <p>I am not adept at Jmeter, so please bear with me.</p>