I am trying to filter a value from a string using regular expressions, for example filtering out the URL from a <a href=""/> tag.
<a href="http://www.example.com">
I looked through the re library and the regexp that should match the string should be
r'<a href="(.*)">'
Now what’s the best way to save this value into a variable?
You shouldn’t parse html with regex, but since you said that is only an example…
If you expect to always find a match:
If you don’t know if it will match: