I need to flag sentences when there is text in parentheses but only if a certain word (myword
) is present.
These are some possible options of the word appearing inside parentheses:
(random text myword)
(random text myword random text)
(myword random text)
(myword, random text)
(random text, myword random text)
The output should contain parentheses and text inside.
UPD: The instances above might be surrounded by text with parentheses, i.e. (random text) random text (random text myword) random text (random text)
.