View Single Post
Old 11-27-2024, 01:39 AM   #2
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,832
Karma: 30277270
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by RenniePet View Post
I use calibre to convert my Word docx files to epub, and think it's great.

Now I'd like to try to automate some of the manual editing I do in Word before each conversion, by using the regex Search & replace facility, if possible.

Questions:

What exactly is the regex function being applied to? Is it working on some kind of html, or an internal docx format of the text?

Can the regex function recognize a multi-line target? And if so, replace it with fewer lines? And how?
The help text for Search & Replace is :
Quote:
Search and replace uses regular expressions. See the regular expressions tutorial to get started with regular expressions. Also clicking the wizard button below will allow you to test your regular expression against the current input document. When you are happy with an expression, click the Add button to add it to the list of expressions.
That would seem to imply it works on the input file - i.e. the DOCX. But I don't know for certain that that is the case. Kovid Goyal will no doubt provide a definitive response.

FWIW, I use a couple of Word Add-ons that have 'advanced' S&R tools:

e-Book Tools - a Word add-in - even though it's no longer under development, it still works for me with the latest Office 365.

Translator Tools – Productivity tools for editing and translation

BR
BetterRed is online now   Reply With Quote