I am trying to extract all the <input >
tags out of a <form>
tag. I have created a regexp which can identify the entire <form>
tag and all the code up to the ending </form>
but I cannot figure out how to match all the <input[^>]+>
within that.
EDIT: The data is a string. I cannot use DOM functions because it's not part of the document. if I insert it into a hidden tag, it changes the layout of the page because the string contains an entire HTML page including links to external stylesheets.