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 05-13-2018, 05:36 AM   #1
Sam Sahara
Connoisseur
Sam Sahara began at the beginning.
 
Posts: 53
Karma: 10
Join Date: Aug 2014
Device: lambda k21
Editor: conversion to lowercase with regex

Hallo.

Can you suggest a regex to convert a group of uppercase letters to the same letters but lowercase?

Let say I have the following strings:

Code:
I. GROUP ONE
II. GROUP TWO
III. GROUP THREE
IV. GROUP FOUR
I'm looking for a regex to convert in the following way:

Code:
I. Group one
II. Group two
III. Group three
IV. Group four
---------

EDIT
I tried the following:

search
Code:
(.*?)\. ([A-Z])([A-Z ]*)
replace
Code:
\1. \u\2\L\3\E
but calibre gives: "error:incomplete escape \u at position xx"

Last edited by Sam Sahara; 05-13-2018 at 06:45 AM.
Sam Sahara is offline   Reply With Quote
Old 05-13-2018, 06:51 AM   #2
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: 15,079
Karma: 24708566
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo: Touch, Glo, Aura H2O, Glo HD, Aura ONE, Clara HD
You can do that with one of the Regex functions. The search should be:

Code:
[IVX]+\. (.*?<)
That assumes the lines are wrapped in a tag.

Then select "Regex-funtion" as the mode and "Title-case text" as the function.
davidfor is offline   Reply With Quote
Reply

Tags
editor, regex

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
RegEx: anchor problem in editor DrChiper Editor 4 04-09-2018 09:15 AM
regex in calibre editor mrmikel Editor 2 02-01-2014 10:39 AM
Guide to Regex in Calibre Editor vs Notepad++ Agama Editor 6 12-23-2013 05:10 AM
Conversion and Regex Help thedevilsjester Calibre 0 07-16-2010 06:10 PM
Need help with a conversion regex - can't match newline ereader123 Calibre 2 03-29-2010 10:58 AM


All times are GMT -4. The time now is 11:53 AM.


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