RegEx to split paragraphs into single sentences?

\n and paragraph break are the same thing, but the regex code for it isn’t accepted in that dialog. I wonder why?

1 Like

Indeed, but don’t know why…

Thanks again.
I wanted this so that I can “explode” a chapter into its single sentences for further editing of the content/flow/narrative on printout.
For some situations (like revamping a chapter’s flow), I find it much easier to do when taking out the concept of paragraphs. Giving the single sentences the freedom to be moved around. (In a paragraph destructive way that don’t actually feels like I am destroying things so much.)

Anyways, all this to say that I have modified the formula like this :
$1▪¶▪$2

image

Not only does it give me a clue on the printout about what previously was a paragraph and what wasn’t, it also serve that once I am done editing the printout and commited the edits to my original Scrivener document, replacing ▪¶▪ (or call it ▪\n▪, whichever) with a space, all my sentences that were previously consecutive inside a single paragraph are then brought back together as the said paragraph.
Sequences that were broken by insertion of new content simply leave as a marker (either at the beginning or the end of the sentence (due to the fact that the broken junction is now missing one of its two )), serving as a good reminder that this is a place where the initial flow has been severed/interrupted/modified.

I’m very happy with all of this.

1 Like

Nice development, with very powerful tools, and beyond just the technical, Vincent.

I think the paragraph symbol thing is Mac-only – and ‘newlines’ can anyway be complicated. Regex uses the straightforward Unix/Linux \n, as you found. And it should work on the output side also, but here we are in that land of a special software interpretation – perhaps it is once again Qt… - and your solution of just embedding a keyboard newline makes it work.

A pretty useful result, and I’m thinking about the editing idea you built it for – could be useful to really take apart something that’'s become awkward, and bring it into working as it might.

Makes you think about whether something like this could become a feature…??

1 Like