|
|
#121 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,081
Karma: 2677223
Join Date: Dec 2010
Device: Kindle 3
|
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. |
|
|
|
|
|
#122 | ||
|
Gadget Freak
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,033
Karma: 1025474
Join Date: Nov 2007
Location: US
Device: Sony 700; Entourage Edge, Kindle 3, Pocket Edge
|
Quote:
Quote:
.
__________________
User of both the 10" EE & 7" PE. Visit edge/pocket edge forum. calibre User Manual. |
||
|
|
|
|
Enthusiast
|
|
|
|
#123 | |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,081
Karma: 2677223
Join Date: Dec 2010
Device: Kindle 3
|
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? |
|
|
|
|
|
|
#124 |
|
frumious Bandersnatch
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,142
Karma: 2474345
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon
|
|
|
|
|
|
|
#125 |
|
Gadget Freak
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,033
Karma: 1025474
Join Date: Nov 2007
Location: US
Device: Sony 700; Entourage Edge, Kindle 3, Pocket Edge
|
@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.
__________________
User of both the 10" EE & 7" PE. Visit edge/pocket edge forum. calibre User Manual. Last edited by Gunnerp245; 08-12-2012 at 10:29 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 |
||
|
|
|
|
|
#127 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,081
Karma: 2677223
Join Date: Dec 2010
Device: Kindle 3
|
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:
"\>[^"](.*?)" |
|
|
|
|
|
#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
|
|||
|
|
|
|
|
#129 |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,830
Karma: 23232374
Join Date: Jan 2010
Device: Kindle Fire HD, Kindle 2
|
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?
__________________
“Politics: A strife of interests masquerading as a contest of principles. The conduct of public affairs for private advantage.” |
|
|
|
|
|
#130 | |
|
Addict
![]() Posts: 312
Karma: 22
Join Date: Dec 2010
Location: EU
Device: iPad, iPhone, iPod
|
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! |
|
|
|
|
|
|
#131 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,081
Karma: 2677223
Join Date: Dec 2010
Device: Kindle 3
|
|
|
|
|
|
|
#132 |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,830
Karma: 23232374
Join Date: Jan 2010
Device: Kindle Fire HD, Kindle 2
|
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?
__________________
“Politics: A strife of interests masquerading as a contest of principles. The conduct of public affairs for private advantage.” |
|
|
|
|
|
#133 | |
|
Staff to 4 Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 10,713
Karma: 2485850
Join Date: Aug 2009
Location: The (original) Silicon Valley, USA
Device: Galaxy Tab 2,Black Astak PEz, K4NT(now Wifes)
|
Quote:
which is why it is matching </span></a> if your id has an ending numbers use that to narrow the scope:(.+?\d+)"></a>
__________________
Using: Ubuntu(32 bit):Oneric,Precise and XPpro SP3, W7HP(64)- - Libre Office w/Writer2EPUB
|
|
|
|
|
|
|
#134 | |
|
frumious Bandersnatch
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,142
Karma: 2474345
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon
|
Quote:
The whole red part would be matched by the first (.*?), right? |
|
|
|
|
|
|
#135 | |||
|
Addict
![]() Posts: 312
Karma: 22
Join Date: Dec 2010
Location: EU
Device: iPad, iPhone, iPod
|
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. |
|||
|
|
|
![]() |
| Thread Tools | Search this Thread |
|
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 |