This is a context that will find prose paragraphs
\\p\w*\s([^\\]|\\(?!([dlmpqs]\w*|b)\s))*?(?=\\([dlmpqs]\w*|b)\s|\Z):::
To find quotes in the paragraph just add what ever code you want to find the quoted passages. However I avoid using . to find any character because it is not efficient and will stop at line breaks unless you add (?s)
. I prefer to find any character except the one I am looking for like this: ”([^“]*?)“
So this is the full code:
\\p\w*\s([^\\]|\\(?!([dlmpqs]\w*|b)\s))*?(?=\\([dlmpqs]\w*|b)\s|\Z):::”([^“]*?)“
The context is somewhat complicated and could be simplified depending on your markup.
It starts with \\p\w*\s
, which selects \p \pm \pmo \pi1 \pc etc. It continues until it finds a tag that marks the end of a paragraph or the end of the chapter \\([dlmpqs]\w*|b)\s|\Z
, which here includes all the tags that begin with \d \l \m \p \q and \s and the tag \b (but not \bd). The text selector is ([^\\]|\\(?!([dlmpqs]\w*|b)\s))*?
which means any character that is not \ or any \ that is not followed by one of the tags that mark the end of a paragraph.