I have another question. Lets say you have a slightly different setup. For example, lets say the first set of characters is instead <a href="/quote/ and the last character is ? such that the string would now read <a href="/quote/dog?<a href="/quote/cat?<a href="/quote/monkey?<a href="/quote/human?. How would you get the words: dog, cat, monkey, and human out of this? I tried with the code provided and it doesn't seem to work as I would have expected. The code I tested is:
import re g2='<a href="/quote/dog?<a href="/quote/cat?<a href="/quote/monkey?<a href="/quote/human?' words=re.findall("<a href=\"/quote/(.+?)?",g2)And it returns words=['d', 'c', 'm', 'h']. Why isn't this working in this case?