Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Editor

Notices

Reply
 
Thread Tools Search this Thread
Old 02-12-2020, 10:32 AM   #16
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 25,057
Karma: 34462661
Join Date: Aug 2009
Location: The Central Coast of California
Device: K4NT(Fixed,New Bat.), Galaxy Tab A, Kobo Aura2
'Im Far from being an expert.
If to want to split and insert., You need a capture for ALL the pieces so yo keep them. (There are more complicated non-capture ways. this works for me)

(.+?)\:(.+?) <<remove existing colon
\1 \2: <<place something at the end

Want to discard part 1? just don't place it back

\2:
theducks is offline   Reply With Quote
Old 02-13-2020, 10:03 AM   #17
Pachuqismo
Member
Pachuqismo began at the beginning.
 
Posts: 19
Karma: 10
Join Date: Nov 2009
Device: SM-T820, Galaxy S7
The removal of the existing colon, as you suggested, and replacing with what I prefer (space on both sides of the colon) worked.

To spell it out for anyone else interested, see the attached screen capture.

However, any existing

Title : Subtitle will get an additional space before the colon and becomes

Title__: Subtitle

(I use underscore since two spaces will get weeded to one by this editor)

The solution would be to first do a run converting any existing Title_:_Subtitle to Title:_Subtitle and then convert all to the desired outcome.

Many thanks theducks for the efforts !!!
Attached Thumbnails
Click image for larger version

Name:	Calibre Edit_meta_info Title; Subtitle.png
Views:	33
Size:	147.6 KB
ID:	177113  

Last edited by Pachuqismo; 02-13-2020 at 10:31 AM.
Pachuqismo is offline   Reply With Quote
Old 02-13-2020, 06:16 PM   #18
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 19,061
Karma: 32527537
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by Pachuqismo View Post
The removal of the existing colon, as you suggested, and replacing with what I prefer (space on both sides of the colon) worked.

To spell it out for anyone else interested, see the attached screen capture.

However, any existing

Title : Subtitle will get an additional space before the colon and becomes

Title__: Subtitle

(I use underscore since two spaces will get weeded to one by this editor)

The solution would be to first do a run converting any existing Title_:_Subtitle to Title:_Subtitle and then convert all to the desired outcome.
The the following will do what you want:

Code:
(.*?)\s*\:\s*(.*?)
And the replace is simply:

Code:
\1 : \2
If there are multiple spaces around the colon, it will remove all except one, but,

And, I missed what you wanted to do as you posted on a thread about a completely different topic. The thread is about working in the editor. You are using the metadata search and replace. While regex is common in both places, the regex needed to change the title is a lot simpler than that needed in the editor.
davidfor is offline   Reply With Quote
Old 02-14-2020, 10:45 AM   #19
Pachuqismo
Member
Pachuqismo began at the beginning.
 
Posts: 19
Karma: 10
Join Date: Nov 2009
Device: SM-T820, Galaxy S7
Quote:
Originally Posted by davidfor View Post
The the following will do what you want:

Code:
(.*?)\s*\:\s*(.*?)
And the replace is simply:

Code:
\1 : \2
This is very elegant - many thanks for that!

Quote:
And, I missed what you wanted to do as you posted on a thread about a completely different topic.
As mentioned, same as reinsley posted in #1

Quote:
The thread is about working in the editor
Sorry, I missed that.

Cheers!

Last edited by Pachuqismo; 02-14-2020 at 10:56 AM.
Pachuqismo is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
bookerly font - space after speech mark for C, K stumped Amazon Kindle 7 05-08-2016 11:57 AM
Help with RegEx to parse title with colon racergirl76 Library Management 3 02-16-2016 02:13 AM
EPUB to MOBI, kindle shows extra space after quotation mark akita Kindle Formats 29 02-05-2016 02:14 AM
Hard Sci-Fi Space Opera- HEGEMONY, by Mark Kalina markkalina Self-Promotions by Authors and Publishers 54 09-04-2012 10:01 AM
search replace puts \1(space) in text isabelle1231 Sigil 2 05-21-2011 04:46 PM


All times are GMT -4. The time now is 05:13 AM.


MobileRead.com is a privately owned, operated and funded community.