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 10-21-2017, 05:56 AM   #1
larysa
Zealot
larysa began at the beginning.
 
Posts: 117
Karma: 10
Join Date: Feb 2016
Device: iPad mini 4
regex capitalize first letter

Hi, I’ve book with <p class:”body”>word even space</p> on each <p class> but i want (with search & replace with regex) replace every my p class with capitalize first letter <p class:”body”>Word even space</p>

How to this? Tanxs. Regards
larysa is offline   Reply With Quote
Old 10-21-2017, 10:29 AM   #2
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: 29,762
Karma: 54401244
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
it might work better
<p class="body"

Code:
<p class=”body”>([a-z])
Code:
<p class=”body”>\U\1\E
theducks is online now   Reply With Quote
Old 10-21-2017, 11:47 AM   #3
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: 29,762
Karma: 54401244
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
It has been pointed out that this only works with a PCRE based S&R (Sigil)

PS you should use straight quotes in tags
theducks is online now   Reply With Quote
Old 10-21-2017, 12:13 PM   #4
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,845
Karma: 128597114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by theducks View Post
It has been pointed out that this only works with a PCRE based S&R (Sigil)

PS you should use straight quotes in tags
Then the Sigil regex needs to be removed.
JSWolf is offline   Reply With Quote
Old 10-21-2017, 09:04 PM   #5
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: 24,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by larysa View Post
Hi, I’ve book with <p class:”body”>word even space</p> on each <p class> but i want (with search & replace with regex) replace every my p class with capitalize first letter <p class:”body”>Word even space</p>
There are several Regex-functions to change the case of matched text. This is one of the modes for searching. "Capitalize text (ignore tags)" should do it.
davidfor is offline   Reply With Quote
Old 10-22-2017, 12:52 PM   #6
larysa
Zealot
larysa began at the beginning.
 
Posts: 117
Karma: 10
Join Date: Feb 2016
Device: iPad mini 4
@theducks: tanxs, now i try! PS i use calibre, not sigil!
@ davidfor: I’ve try regex capitalize text, but not work! On find i write <p class=“body”>
and on regex i type on Capitalize text (ignore tags), then click on find, calibre find my p class but don’t capitalize my first word! Why?
larysa is offline   Reply With Quote
Old 10-22-2017, 08:07 PM   #7
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: 24,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by larysa View Post
@theducks: tanxs, now i try! PS i use calibre, not sigil!
@ davidfor: I’ve try regex capitalize text, but not work! On find i write <p class=“body”>
and on regex i type on Capitalize text (ignore tags), then click on find, calibre find my p class but don’t capitalize my first word! Why?
Actually, I hit something similar to what you want last night. The case I had looked like:
Code:
<p>Fred said, "this is some dialog
That was scattered through the book with different names. From memory, the search I used was:

Code:
<p>\w+ said, ("[[:lower:]])
Then I used one of the case changing functions, I think it was the "Capitalize text (ignore tags)". What it did is to capitalize what was in the matching group and leave the rest unchanged.

I think that's what I did. I'm at work and can't look back through the search history to be sure. Or test it.
davidfor is offline   Reply With Quote
Old 10-23-2017, 04:44 AM   #8
larysa
Zealot
larysa began at the beginning.
 
Posts: 117
Karma: 10
Join Date: Feb 2016
Device: iPad mini 4
Yeeesss, work! Tanxs to everybody!
larysa is offline   Reply With Quote
Old 10-23-2017, 12:04 PM   #9
larysa
Zealot
larysa began at the beginning.
 
Posts: 117
Karma: 10
Join Date: Feb 2016
Device: iPad mini 4
With suggestion of theducks, capitalize word work better...my only forgetfulness is ([a-z]) on <p class=”body”> on find field!
Tanxs. Regards
larysa 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
Capitalize first letter in custom column mhbeyle Library Management 0 11-04-2016 10:18 AM
Regex to find small letter followed by capital? Vortex Library Management 2 03-18-2016 06:16 AM
Regex problem: s&r adding space between emdash and first letter... Witkacy Sigil 1 11-07-2014 03:35 PM
Capitalize CC-GoE Library Management 6 03-30-2014 07:05 AM
Can I capitalize a letter? Jorge Junior ePub 13 11-14-2012 10:30 PM


All times are GMT -4. The time now is 01:33 PM.


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