View Single Post
Old 06-05-2020, 01:15 PM   #6
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 46,840
Karma: 169712582
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by d351r3d View Post
If you just put in "find":
Code:
^.+$
Could you put in "replace":
Code:
<p></p>
Quote:
Originally Posted by theducks View Post
NO!

You did not insert any captured data (the \1 )

<p>\1</p>

You did not even CAPTURE any data
Put a ( ) pair around the part you want to capture (if there is a real ( or ) in the template: escape those: \( or \)
Quote:
Originally Posted by d351r3d View Post
So you can't do what I'm trying to do with Regex? Like regex can't be like "oh that's the beginning of a line with content, let me just put something before that and there's the end of a line, let me just put something after that line with content."
What he is saying is you need to capture the data first and then place it in the replace string. See the brackets around the find string and the \1 in the replace string.

HOWEVER: Please note that this will match EVERY line in your document no matter what it is.

In the case of your sample code:

Code:
(^.+$)
Could you put in "replace":
Code:
<p>\1</p>
I would recommend either pasting your text into a blank text file or using Notepad++ or equivalent to do the replacement in the text before pasting it into Sigil. Notepad++ can use the same find/replace strings making easier for me.

Last edited by DNSB; 06-05-2020 at 09:37 PM.
DNSB is online now   Reply With Quote