I've found multiple posts with negative lookaheads, but I can't seem to make it work for this particular use case.
I have multiple lines with one of the following 4 patterns (and possibly more than 2 options):
text [option1/option2] text
text] [option1/option2] more text
text [option1/option2] [text
text] [option1/option2] [text
Looking for a regex (more likely multiple: one for left and one for right) that will match only the single-bracketed text (in bold below):
text [option1/option2] text
text] [option1/option2] more text
text [option1/option2] [text
text] [option1/option2] [text
Making multiple passes over the lines is fine. Also, this is Python, so if there's a completely different way, I'm open to suggestions. This are just strings in a list.
Thanks in advance -mS