I have multiple HTML tags in the HTML response that I get which is basically values inside a Select Drop Down. I need to get value of a specific attribute when I know the text inside the HTML tag which is the name of the value being selected in the dropdown.
For eg.
<option value="01" id="01" >ABC</option>
<option value="02" id="02" >XYZ</option>
multiple option tags like this. etc.
I have the value ABC/XYZ in a variable and based on that variable I need to get the value inside the "value" attribute using Regex.And Regex is the only way supposed to be used.
Value from "value" tag is what I would need to fetch,if it is the whole data under the tag for ABC value would also suffice.
I tried with the below regex but this seems to be giving wrong results when the data is changed.The below expression tries to return the whole content from the option tag which meets the condition. (?<=option)(?=[^#]*ABC)[^#]+(?=