I saw question here: Regex to capture {} which is similar to what I want, but I cannot get it to work.
My data is:
You can use re.findall
to get all the matches, though you'll get them in a list, and you don't need capture groups:
m = re.findall('\[[^\[\]]*\]', '[Honda] Japanese manufacturer [VTEC] Name of electronic lift control')
Gives ['[Honda]', '[VTEC]']
so you can get each with:
print(m[0])
# => [Honda]
print(m[1])
# => [VTEC]