View Single Post
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: 18,604
Karma: 30757200
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