|
|
#1 |
|
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 287
Karma: 9400
Join Date: Aug 2010
Location: Helsinki
Device: Kobo Clara Colour
|
Regex search and replace
Trying to find (and get rid of) all instances of this
Code:
<div class="mbp_pagebreak" id="calibre_pb_0"> I have no idea how regex search works or anything, I've just been following instructions I've been given before. What do I need to search to be finding this bit of code? |
|
|
|
|
|
#2 |
|
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,976
Karma: 65700000
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
What is the range (next to the Mode 'regex') you set?
All text files BTW I use a less wild term Code:
<div class="mbp_pagebreak" id="calibre_pb_\d+"> |
|
|
|
| Advert | |
|
|
|
|
#3 | |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,299
Karma: 8891824
Join Date: Jun 2010
Device: Kobo Clara HD,Hisence Sero 7 Pro RIP, Nook STR, jetbook lite
|
The easy and fastest way is to use Diaps Editing Toolbag plugin for the editor.
bernie Quote:
|
|
|
|
|
|
|
#4 | |
|
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 287
Karma: 9400
Join Date: Aug 2010
Location: Helsinki
Device: Kobo Clara Colour
|
Quote:
The settings I was using were Mode: regex, all text files, Down, Wrap. (I'm not sure I understand the question so I hope that's what you were asking?) |
|
|
|
|
|
|
#5 | |
|
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 287
Karma: 9400
Join Date: Aug 2010
Location: Helsinki
Device: Kobo Clara Colour
|
Quote:
Last edited by Siavahda; Yesterday at 04:09 AM. |
|
|
|
|
| Advert | |
|
|
|
|
#6 |
|
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,976
Karma: 65700000
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
|
|
|
|
|
|
#7 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,643
Karma: 30496938
Join Date: Mar 2010
Location: UK
Device: Kobo Forma, Icarus, iPad Mini 2, Kobo Touch, Google Nexus 7
|
Out of curiosity, does Diap's plug-in deal with indented CSS files? I'm engaged in cleaning up my library using Edit Books, and the biggest issue I've found is missing font-family fallbacks. There's one book with over 2500... (It's a graphic novel which I don't send to my Kobo, but I'd like to clean it anyway.)
Unfortunately, because of the indents, search and replace or regex searches don't find them. |
|
|
|
|
|
#8 | |
|
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 82
Karma: 392326
Join Date: Feb 2023
Device: Kobo Libra 2
|
Quote:
OTOH, there's basically no reason why regexp couldn't find indented lines - hard to say what would be the issue without seeing the stylesheet, but something like ^\s+@ would match any number of spaces from line start to @ - thought the challenge might be to find a regexp that doesn't overmatch. |
|
|
|
|
|
|
#9 | |
|
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 287
Karma: 9400
Join Date: Aug 2010
Location: Helsinki
Device: Kobo Clara Colour
|
Quote:
If I go to the plugin menu in the editor, I have Convert CSS cm to em Edit Span & Divs Run Epubcheck Smarten punctuation (the sequel) The convert css one and the smarten punctuation one both have arrows, with a tick box. But the Edit Span & Divs one doesn't? |
|
|
|
|
|
|
#10 | |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,643
Karma: 30496938
Join Date: Mar 2010
Location: UK
Device: Kobo Forma, Icarus, iPad Mini 2, Kobo Touch, Google Nexus 7
|
Quote:
I was wondering because it's seriously tedious clearing these missing CSS font fallbacks; being able to search and replace would simplify the task enormously. (Mind you, I'm still on calibre 7.26.) I don't mind doing a search and replace for each font value, what's tedious is manually replacing dozens of the same value. |
|
|
|
|
|
|
#11 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,643
Karma: 30496938
Join Date: Mar 2010
Location: UK
Device: Kobo Forma, Icarus, iPad Mini 2, Kobo Touch, Google Nexus 7
|
Checked in Pages with 'show invisible' and the whitespace is 4 spaces:
.calibre7 { display: block; font-family: "Times New Roman", serif; text-align: justify; text-indent: 2em; margin: 0 } But any search for the block or the specific expression isn't finding anything. |
|
|
|
|
|
#12 | |
|
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,976
Karma: 65700000
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
FWIW I don't worry about a fallback font on books for my use if the font is embedded or already on my device. |
|
|
|
|
|
|
#13 | |
|
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,976
Karma: 65700000
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
![]() I had placed the Toolbag icon on the Toolbar (Preferences IN the Editor)and it has the arrow, where the Plugins menu does not offer the option |
|
|
|
|
|
|
#14 | |
|
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 82
Karma: 392326
Join Date: Feb 2023
Device: Kobo Libra 2
|
Quote:
Last edited by Lukusaukko; Yesterday at 10:40 AM. |
|
|
|
|
|
|
#15 | |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,643
Karma: 30496938
Join Date: Mar 2010
Location: UK
Device: Kobo Forma, Icarus, iPad Mini 2, Kobo Touch, Google Nexus 7
|
Quote:
But I'll give theducks beautifying suggestion a try first. |
|
|
|
|
![]() |
| Tags |
| regex |
| Thread Tools | Search this Thread |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Search and Replace with Regex | Wiggo | Library Management | 9 | 09-29-2024 07:51 AM |
| how to replace text with Search and Replace with regex on Calibre | darrnih | ePub | 2 | 04-02-2024 02:10 AM |
| Regex in search problems (NOT Search&Replace; the search bar) | lairdb | Calibre | 3 | 03-15-2017 07:10 PM |
| regex search/replace | Sharlene | Sigil | 10 | 01-28-2012 04:14 AM |
| need regex help search and replace | schuster | Calibre | 4 | 01-10-2011 09:00 AM |