I collected from the web a dataset that contains a set of strings that follows a pattern, example:
string <- c("<option value="AÉCIO NEVES|1117315%23221!MG=PSDB?74646">AÉCIO NEVES</option>",
"<option value="KIM KATAGUIRI|1117562%23366!SP=DEM?204536">KIM KATAGUIRI</option>")
But I just want to extract those numbers that are between ?
and >
.
In this example, I want to extract 74646 and 204536. Is there a way to collect those numbers automatically and then putting them in a new data frame?