08-11-2012, 09:44 AM | #121 |
Grand Sorcerer
Posts: 5,635
Karma: 23191067
Join Date: Dec 2010
Device: Kindle PW2
|
A quick and dirty solution would be:
Find: (chapter) ([[:lower:]]+) Replace: \u\1 \u\2 This requires Sigil 0.5.3 (or higher). Last edited by Doitsu; 08-11-2012 at 09:56 AM. |
08-11-2012, 09:03 PM | #122 | |
Gadget Freak
Posts: 1,169
Karma: 1043832
Join Date: Nov 2007
Location: US
Device: EE, Note 8
|
Quote:
|
|
08-12-2012, 02:35 AM | #123 | |
Grand Sorcerer
Posts: 5,635
Karma: 23191067
Join Date: Dec 2010
Device: Kindle PW2
|
Quote:
AFAIK, Calibre uses the Python regular expression library, which doesn't support the \u operator. The expressions that I suggested will work in Sigl or any text editor with PCRE support. Is there any particular reason why want to use Calibre to replace the text? |
|
08-12-2012, 03:40 AM | #124 |
frumious Bandersnatch
Posts: 7,533
Karma: 19000001
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
|
08-12-2012, 09:51 AM | #125 |
Gadget Freak
Posts: 1,169
Karma: 1043832
Join Date: Nov 2007
Location: US
Device: EE, Note 8
|
@Doitsu/Jellby
I was reading through the regex sticky and posted my question before realizing which software forum I was in. I have been able to glean very helpful information. Though the other forum has a regex sticky it does not seem as detailed as this one. I have moved my query here. Last edited by Gunnerp245; 08-12-2012 at 10:29 AM. |
08-23-2012, 09:55 AM | #126 | ||
Junior Member
Posts: 6
Karma: 10
Join Date: Aug 2012
Device: Samsung Tab 2 GT-P3110
|
I hate my first post to be a question rather than an answer but needs must when the devil drives.
I have an epub where speech quotes are missing from the start of the line e.g. Quote:
This seems to work (I know there are cases where it fail, but I'm just finding and not auto-fixing) Quote:
Is there something special about Sigil's regex that I'm overlooking? Many thanks in advance |
||
08-23-2012, 12:11 PM | #127 |
Grand Sorcerer
Posts: 5,635
Karma: 23191067
Join Date: Dec 2010
Device: Kindle PW2
|
IMHO, the problem is \w*\W*, which matches a sequence of 0 or more word characters followed by 0 or more non-word characters. I.e., it will at most match one word plus a space or punctuation character. Try .*? instead:
Code:
"\>[^"](.*?)" |
08-23-2012, 12:22 PM | #128 | |||
Junior Member
Posts: 6
Karma: 10
Join Date: Aug 2012
Device: Samsung Tab 2 GT-P3110
|
Quote:
Outside of Sigil the regex that I was using worked fine which is what I'm finding odd. Using Quote:
Quote:
Need to think about this, I'm missing something really obvious |
|||
08-23-2012, 12:50 PM | #129 |
Grand Sorcerer
Posts: 27,903
Karma: 198500000
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Not really that odd. There are several different regex engines that all have subtle differences. So the questions would be: what application are you using where your original regex does succeed? And what version of Sigil are you using where it doesn't succeed?
|
09-25-2012, 09:01 AM | #130 | |
Addict
Posts: 385
Karma: 3102
Join Date: Dec 2010
Location: EU
Device: Kobo Aura ONE, Kobo Libra H20
|
Strange issue
Most surely, I'm not understanding this the right way.
I'm cleaning up some epubs and have noticed that some of them have anchor tags with a class and an id but without any hyperlink. Some epubs have several hundred in between the text. So I'm using this regex to find anchor links with nothing inside them Quote:
I would like to be able to restrict the findings to only this situation. Many thanks! |
|
09-25-2012, 09:41 AM | #131 |
Grand Sorcerer
Posts: 5,635
Karma: 23191067
Join Date: Dec 2010
Device: Kindle PW2
|
|
09-25-2012, 09:47 AM | #132 |
Grand Sorcerer
Posts: 27,903
Karma: 198500000
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
I'm not certain why that expression would match instances with spans or text inside the anchor tags. It shouldn't really.
You might try: Code:
<a class="([^>]*?)" id="([^>]*?)"></a> But I can't get your expression to misbehave, really. It seems to do (for me anyway) what you've intended it to do. Can you give any examples of code it's matched that you don't think it should match? |
09-25-2012, 09:48 AM | #133 | |
Well trained by Cats
Posts: 30,372
Karma: 58053698
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
which is why it is matching </span></a> if your id has an ending numbers use that to narrow the scope:(.+?\d+)"></a> |
|
09-25-2012, 10:40 AM | #134 | |
frumious Bandersnatch
Posts: 7,533
Karma: 19000001
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
Quote:
The whole red part would be matched by the first (.*?), right? |
|
09-25-2012, 10:59 AM | #135 | |||
Addict
Posts: 385
Karma: 3102
Join Date: Dec 2010
Location: EU
Device: Kobo Aura ONE, Kobo Libra H20
|
Thanks, Doitsu and DiapDealer
This is from Clive Barker's Imajica Using Quote:
Clicking on Find, the first match is this one: Quote:
Quote:
Strange. |
|||
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Examples of Subgroups | emonti8384 | Lounge | 32 | 02-26-2011 06:00 PM |
Accessories Pen examples | Gunnerp245 | enTourage Archive | 15 | 02-21-2011 03:23 PM |
Stylesheet examples? | Skitzman69 | Sigil | 15 | 09-24-2010 08:24 PM |
Examples | kafkaesque1978 | iRiver Story | 1 | 07-26-2010 03:49 PM |
Looking for examples of typos in eBooks | Tonycole | General Discussions | 1 | 05-05-2010 04:23 AM |