With pandoc you can do this I think
pandoc -t plain file.docx | grep "pattern"
Even better you can have pandoc output markdown.
Which almost looks like what this terminal program is doing ?