I'm looking to the first instance of a match two square brackets using regular expressions. Currently, I am doing
regex = re.compile("(?<=(\[\[)).*(?=\]\])")
r = regex.search(line)
which works for lines like
[[string]]
returns string
but when I try it on a separate line:
[[string]] ([[string2]], [[string3]])
The result is
string]] ([[string2]], [[string3
What am I missing?