I need to parse the below text and read the value for id and name, and name is optional. I am getting 'txt" name="thistext' as the value for id.
input id="txt" name="thistext"
This is the regex I am using -
input\s+id="(?<id>.*)("+?)(?:(\s+name="(?<name>.*)(.*?")))?
Full match 0-30 input id="txt" name="thistext"
Group id
10-29 txt" name="thistext
Group 2. 29-30 "