I have a form with a number of input and select html elements. The problem is that every input and select has a name but not all of them have values (Select by default) and at least one select element has no " quotation marks in the name attribute.
I am willing to get all the names and values with one expression.
Here is the form (without \n and \r signs):
And here his my code:
MatchCollection mtches;
mtches = Regex.Matches(registerForm, "(?:(?:<input)|(?:<select))[^>]*?name=\"?(?<name>.+?)(?:(?:\")|(?:>))[^>]*?(?:value=\"(?<value>.*?)\")?[^>]*?> ");
I successfully got all the names of each input and select, but the problem is that it doesn't extract the value matches.