regular expression find and replace including end of line

15 views
Skip to first unread message

Dennis J

unread,
Mar 29, 2025, 9:57:16 AMMar 29
to anthemi...@googlegroups.com
Hi Jutoh list members,

Thanks to all those who create and support Jutoh.

I'm stuck on a find and replace problem. The following gets me close, but does not do exactly what I want.

Find: '(\w)$'

Replace: '$1 '

(Without the quote marks, but there is a space in the replace expression.)
And the regular expressions box is ticked (checked).

This fails to replace the end of line.

What I want to do is find an end of line _without_ a full stop (period) before it, and effectively replace (remove) that end of line and substitute a space.

Searching on: ~{newline}
never matches anything in any document I've tried it on.

Thanks for your attention.

Dennis

Jutoh Classic
Version 3.23.0 Intel 64-bit
Built Mar 9 2025

Julian Smart

unread,
Mar 29, 2025, 12:40:23 PMMar 29
to anthemi...@googlegroups.com
Hello Dennis,

Thank you for the thanks!

Unfortunately search and replace only works on a per-paragraph basis, so it's not possible to replace the end of line (that is, end of a paragraph) automatically. Sorry about that.

Regards,

Julian

Dennis J

unread,
Mar 29, 2025, 9:48:00 PMMar 29
to anthemion-jutoh
Thanks to everyone who replied so quickly.

Knowing that what I was trying to do is not possible is actually useful, I can stop trying, and get on with an alternative way of doing things. In this case, use the regex to find the problems, and then manually fix them.
:-)

Dennis
--
You received this message because you are subscribed to the Google Groups "anthemion-jutoh" group.
To unsubscribe from this group and stop receiving emails from it, send an email to anthemion-jut...@googlegroups.com.

Antonio Costanzo

unread,
Mar 30, 2025, 6:15:09 AMMar 30
to anthemion-jutoh
Hi Dennis,

For this work, you maybe find useful this: "Format > Spacing > Merge paragraph”. 

I had a book imported from PDF with many lines broken which I had/have to merge in one paragraph. I even customized that command putting like shortcut for it “alt + X” because the “X” key is just above the “alt“ key in Windows so that it is very confortable in using (“cmd” is probably on the same position as “alt” on Mac). If you want to do the same, you have possibly to disengage “alt/cmd + X” from another command which Jutoh assigns as default. I can’t remember now whether I had actually to that or if “alt + X” was unassigned when I put it like a shortcut for merging paragraphs command.

Antonio

John Niernberger

unread,
Apr 1, 2025, 2:12:38 PMApr 1
to Dennis J, anthemi...@googlegroups.com
Dennis, 

I can’t give you specific feedback on regular expressions in Jutoh (never tried) but assuming they work like they do elsewhere, this site may help you: https://regex101.com/

There are others like it as well, but you put in a string you’re trying to match and expressions it’ll give you feedback on the expression(s) until you get it right.  I would think you can grab the string to match from Jutoh’s generated code.

Apologies if I’m way off base here, just my 2 cents!  :-)

All the best,
john.
--
You received this message because you are subscribed to the Google Groups "anthemion-jutoh" group.
To unsubscribe from this group and stop receiving emails from it, send an email to anthemion-jut...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages