I need to get the value between href's double quotes(") that matches a specific pattern, I tried the above but I can't figure out what's wrong. When I find the pattern in the same line multiple times I get a huge group with information that I don't want:
href="(/namehere/nane2here/(option1|option2).*)"
I need the group between the parenthesis. This pattern repeats itself a lot of times in the string, they're all in the same line.
Example of a string I'm trying to get the values from:
<div>adasdsda<div>...lots of tags here... <a ... href="/name/name/option1/data1/data2"...anything here ...">src</a>...others HTML text here...<a ... href="/name/name/option2/data1"...
[..]is character set which allows us to match only single character among specified inside set. For instance if you have[abc]it will be able to match either singleaorborc, notabc. So instead of character set at[option1|option2]you ware probably looking for group like(option1|option2)..*to[^\"]*.href=".+?", maybe even capture the url in a group) and then filter for what you're looking for. So 3 steps, pluck the urls, filter the urls, do your thingamaginga.