![]() |
#1 |
Groupie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 155
Karma: 112134
Join Date: May 2009
Location: Kuala Lumpur
Device: iPad, K3, K4, T1
|
Search & Replace
I would like to replace the following lines in an Epub of mine:
<p class="timebreak"> <br class="calibre1" /></p> <p class="timebreak"> with just (for example): <p class="left"> I'm not having much success so far and I suppose the blank line in the text to be replaced is the cause of it. From a cursory search I gather something called 'marked text' may help me in Sigil but I do not understand how to use it (assuming I didn't completely misunderstood the advice of another thread which, sadly, is quite probable). Guidance much appreciated. |
![]() |
![]() |
![]() |
#2 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,306
Karma: 13057279
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Make sure you turn on Regex mode:
Search: Code:
<p class="timebreak"> <br class="calibre1" /></p>\s*<p class="timebreak"> Code:
<p class="left"> Code:
<p class="timebreak"> <br class="calibre[0-9]+" /></p>\s*<p class="timebreak"> Blue section says look for zero or more "white space". WARNING: Whenever using Regex, be extremely careful, and DO NOT use "replace all" until you have manually done "Replace" "Replace" "Replace", paying careful attention to make sure everything is working correctly. Save a copy of the EPUB before you go use Regex. |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Groupie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 155
Karma: 112134
Join Date: May 2009
Location: Kuala Lumpur
Device: iPad, K3, K4, T1
|
Worked beautifully. Thanks so much.
|
![]() |
![]() |
![]() |
#4 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,341
Karma: 203719142
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
I like the regex way of doing things (\s+) myself. But in case it's awkward for some, simply highlighting the entire code-block, copying, and then pasting into the searchbox is usually sufficient for matching (even in normal mode). It includes the necessary (but invisible) line endings when pasting.
Obviously if you're trying to match multiple, numbered calibre classes, you'll still need some regex regardless. Last edited by DiapDealer; 10-29-2013 at 08:23 AM. |
![]() |
![]() |
![]() |
#5 | ||
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,306
Karma: 13057279
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Quote:
![]() Sometimes people don't post all the information in their examples. Next, they will come back saying: Quote:
![]() Last edited by Tex2002ans; 10-29-2013 at 12:13 PM. |
||
![]() |
![]() |
Advert | |
|
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
'search & replace' - problem | calimero66 | Conversion | 5 | 10-23-2012 09:26 AM |
Help with a search & replace | mmholt | Library Management | 11 | 10-21-2011 06:49 PM |
Search & Replace :help: | krussell | Calibre | 3 | 08-02-2011 04:45 PM |
Search & Replace/Regex help!! | millertime13 | Conversion | 4 | 07-22-2011 02:40 AM |
Search & Replace | Pat Nickholds | Sigil | 2 | 10-21-2010 11:18 PM |