I would suggest you jump on the developer side of that problem and edit your prose using Asciidoc format. There are quite correct editors (as an example AsciidocFX). This is quite a simple format (more or less like Markdown), but it will allow you to include code with ease, and apply really good text formatting.
As @JohnY commented, Pandoc is really of great use here. It can convert documents from one format to other without much trouble. So you can use your favourite editor to produce a document with your favourite format and then use Pandoc to convert it to ReStructuredText or Markdown.
Mostly you may go with HTML format for source document, as it is pretty ...
Free LibreOffice is a good alternative to the entire Microsoft Office suite. Writer, part of the LibreOffice suite, is similar to MS Word, so if you're accustomed to Word, Writer would require little change in your current practices. In addition, Writer can open and save documents in many formats, including various versions of Word's .DOC and .DOCX.
Most grep tools can only search for a single regular expression. With PowerGREP you can use up to five sets of search terms. Each set can use an unlimited number of regular expressions.
Not free but neither is our time