![]() |
#1 |
Junior Member
![]() Posts: 4
Karma: 10
Join Date: Sep 2009
Device: none
|
Bookdesigner capitilize regex
I have an ebook that has chapter headers as "Chapter XX" instead of "CHAPTER XX". I can find them all with the find regex of "Chapter\W([a-zA-Z0-9]+)" but I cannot find any way to capitalize in the replace expression. I have tried several methods and that all insert the regex code as literal. Is there a way in bookdesigner to capitalize the replacement text?
Thanks |
![]() |
![]() |
![]() |
#2 |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 85
Karma: 82790
Join Date: Jan 2010
Device: PRS-505, PRS-650, PRS-350, PRS-T3
|
Hmm...
maybe I don't understand the problem, and I sure don't have a clue how to use RegExp, but why don't you just use find/replace: find: Chapter ... replace all: CHAPTER ... maybe with "whole word" and/or "match case" checked. ?? acanthicus, who ist wondering, if she is outing herself as extremely stupid... |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Junior Member
![]() Posts: 4
Karma: 10
Join Date: Sep 2009
Device: none
|
I guess I wasn't very clear. Not only do I want to replace "Chapter" but also the one, two. three... that comes after. I can use find/replace for just the "Chapter" part or if it is in the format of "Chapter 1". I would like to be able to replace "Chapter Twenty" with "CHAPTER TWENTY".
|
![]() |
![]() |
![]() |
#4 |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 85
Karma: 82790
Join Date: Jan 2010
Device: PRS-505, PRS-650, PRS-350, PRS-T3
|
Are your headings are formatted as "titles" or "subtitles"? Then you can find in format menu: "capitalize all titles" (subtitles).
|
![]() |
![]() |
![]() |
#5 |
Junior Member
![]() Posts: 4
Karma: 10
Join Date: Sep 2009
Device: none
|
They are what ever they are when I open the file. The main question is how to capitalize replacement text in Bookdesigner.
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Member
![]() Posts: 19
Karma: 62
Join Date: Feb 2010
Device: PRS-505, PRS-600
|
Assuming BookDesigner uses PCRE, you should be able to use the following:
Find: (Chapter\S+\w+) Replace: \U\1\E |
![]() |
![]() |
![]() |
#7 |
Junior Member
![]() Posts: 4
Karma: 10
Join Date: Sep 2009
Device: none
|
I tried that and several other different combination's. It seems Bookdesigner doesn't use a standard of at least not a full set of Regular Expressions.
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Regex engine? | troymc | Sigil | 10 | 07-09-2010 04:52 PM |
What's wrong with this regex? | crutledge | Sigil | 1 | 05-11-2010 01:49 PM |
What a regex is | Worldwalker | Calibre | 20 | 05-10-2010 05:51 AM |
Help with a regex | A.T.E. | Calibre | 1 | 04-05-2010 07:50 AM |
Regex help... | Bobthebass | Workshop | 6 | 04-26-2009 03:54 PM |