title: How to extract certain values using regular expression extractor in JMeter?
body: <p>In the case where I have two identical tags and identical attributes and the only difference is the value, how can I extract the second one?</p>
  
  <pre><code>&lt;data xsi:type="soapenc:string"&gt;0&lt;/data&gt;
  &lt;data xsi:type="soapenc:string"&gt;1&lt;/data&gt;
  </code></pre>
  
  <p>I have tried doing the followings.</p>
  
  <pre><code>&lt;data xsi:type="soapenc:string"&gt;0&lt;/data&gt;&lt;data xsi:type="soapenc:string"&gt;(.+?)&lt;/data&gt;
  </code></pre>
  
  <p>And assign the value to myID.  But when I put in ${myID} in the script, it is using the string "${myID}" instead of the actual value.  Is it that the extraction not working?  Or do I need to use a different variable for it?</p>
  
  <p>I have a different sampler where I have only one tag.  For example,</p>
  
  <pre><code>&lt;data xsi:type="soapenc:string"&gt;0&lt;/data&gt;
  </code></pre>
  
  <p>When I do,</p>
  
  <pre><code>&lt;data xsi:type="soapenc:string"&gt;(.+?)&lt;/data&gt;
  </code></pre>
  
  <p>and assign to myAnotherID, I can use ${myAnotherID} and the value would be used in the script.</p>
  
  <p>So, why is it that ${myID} does not return the value?</p>
  
  <p>Thanks in advance,
  Monte</p>