So using a good markup language reader such as Boost Property Tree would always be advisable over trying to process by hand.
But hypothetically let's say that you had developed a bullet proof regex for parsing html. Because we don't want jealousy to arise from the other victims who've tried to cross the treacherous minefield of markup language processing via regex; we'll just call your regex: regex re
and we'll say that it's 1st capture is the URL that you want to store in this vector
.
With such a legendary regex the only other thing you'll need is regex_token_iterator
. Given the input to process was, const sting text
you could simply do this:
vector<string> foo { sregex_token_iterator(cbegin(text), cend(text), re, 1), sregex_token_iterator() }