I'd like to match in Python any occurences of something between given expression. For example:
dogdogacowadogdog <-- search a word between 'a' characters
<span>tiger<a> <-- search for sth between <span> and <a>
I'd like to match only this something between, so it would cow
and tiger
respectively. However, when using rexexes:
r'a(.*)a'
r'<span>(.*)<a>'
It prints me the whole line and not only this what I am looking for (what is matched by (.*)
). How can I pull this information?