title: What to do Regular expression pattern doesn't match anywhere in string?
body: <p>I am trying to match <code>&lt;input&gt;</code> type “hidden” fields using this pattern:</p>
  
  <pre><code>/&lt;input type="hidden" name="([^"]*?)" value="([^"]*?)" /&gt;/
  </code></pre>
  
  <p>This is sample form data:</p>
  
  <pre><code>&lt;input type="hidden" name="SaveRequired" value="False" /&gt;&lt;input type="hidden" name="__VIEWSTATE1" value="1H4sIAAtzrkX7QfL5VEGj6nGi+nP" /&gt;&lt;input type="hidden" name="__VIEWSTATE2" value="0351118MK" /&gt;&lt;input type="hidden" name="__VIEWSTATE3" value="ZVVV91yjY" /&gt;&lt;input type="hidden" name="__VIEWSTATE0" value="3" /&gt;&lt;input type="hidden" name="__VIEWSTATE" value="" /&gt;&lt;input type="hidden" name="__VIEWSTATE" value="" /&gt;
  </code></pre>
  
  <p>But I am not sure that the <code>type</code>, <code>name</code>, and <code>value</code> attributes will always appear in the same order. If the <code>type</code> attribute comes last, the match will fail because in my pattern it’s at the start.</p>
  
  <p><strong>Question:</strong><br>
  How can I change my pattern so it will match regardless of the positions of the attributes in the <code>&lt;input&gt;</code> tag?</p>
  
  <p><strong>P.S.:</strong> By the way I am using the <em>Adobe Air</em> based <a href="http://gskinner.com/RegExr/desktop/" rel="noreferrer" title="RegEx Desktop tool"><em>RegEx Desktop Tool</em></a> for testing regular expressions.</p>