I'm a regex novice. I have some strings in Python like this: ^b^[word](#30b)
from markdown text. I would like to strip the footnote to get just the word.
I have the following working:
import re
pattern = r"\[([\w]+)\]"
s = "^b^[word](#32b)"
m = re.search(pattern, s)
print(m.group(1))
That snippet extracts the word word
. But now what if I have multiple words inside the brackets like: ^c^[every word](#12c)
and I want to extract all the words? Thanks!