Hi, just can't seem to get this right...
I have a string that has multiple HTML elements in it from another site, and having trouble matching exactly what I need.
Consider: <input type="text" name="first"> <input name="first2" type="text"> <input type="text" name="last" onclick="runFunction()" />
There's a lot of inconsistency in the dynamic code that generates this, I can't assume the order of anything will be consistent between pages.
My goal is to match just the "last" field - everything between <input and />... trying to accomplish with: (<input.*?name="last".*? />) - but that matches two groups - both are the entire string (finding the first occurence of <input, to the last occurence of >
Without putting them all into an array, or looping through the results, how can I match just that single HTML element into just one capture group?
Thanks so much!