![]() |
#136 | ||
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 387
Karma: 3102
Join Date: Dec 2010
Location: EU
Device: Kobo Aura ONE, Kobo Libra H20
|
Thaks everybody.
It seems that Diapdealer's regex... Quote:
The only result found in the same book is: Quote:
|
||
![]() |
![]() |
![]() |
#137 |
frumious Bandersnatch
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,550
Karma: 19500001
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
Yes, it does because it searches for "any character but >" inside the quotes, and that includes the closing quote and the href part.
You probably want something like this: Code:
<a class="([^"]*?)" id="([^"]*?)"></a> |
![]() |
![]() |
![]() |
#138 | |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 387
Karma: 3102
Join Date: Dec 2010
Location: EU
Device: Kobo Aura ONE, Kobo Libra H20
|
Thanks, Jellby
Quote:
Agree ![]() |
|
![]() |
![]() |
![]() |
#139 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,599
Karma: 204624552
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
![]() This discussion is a perfect example of why I've started avoiding (.*?) if at all possible. It'll always bite you in the ass if it can. |
|
![]() |
![]() |
![]() |
#140 | |
Sigil developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,274
Karma: 1101600
Join Date: Jan 2011
Location: UK
Device: Kindle PW, K4 NT, K3, Kobo Touch
|
Quote:
![]() |
|
![]() |
![]() |
![]() |
#141 |
Sigil developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,274
Karma: 1101600
Join Date: Jan 2011
Location: UK
Device: Kindle PW, K4 NT, K3, Kobo Touch
|
In case you haven't noticed, there is a new Search Editor in the 0.6.0 beta that allows you to save your searches (and to run them from a separate dialog if you want). You can even run a group of searches in order.
Some sample regexes are loaded if your list is empty (or if you import the examples/search_entries.ini file). You can export and import entries. So it might be interesting if you post searches you might want to see in the default examples files, and also searches that others might want to import. |
![]() |
![]() |
![]() |
#142 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,599
Karma: 204624552
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
I haven't had much time to play with the latest beta yet, but I can see I need to make the time. ![]() Last edited by DiapDealer; 09-25-2012 at 03:47 PM. |
|
![]() |
![]() |
![]() |
#143 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,731
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
|
That's a cool feature that I actually missed. How about adding a Search Editor... button to the Find and Replace dialog?
|
![]() |
![]() |
![]() |
#144 |
Sigil developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,274
Karma: 1101600
Join Date: Jan 2011
Location: UK
Device: Kindle PW, K4 NT, K3, Kobo Touch
|
|
![]() |
![]() |
![]() |
#145 |
Calibre Plugins Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,730
Karma: 2197770
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
|
@meme - I am shocked you also forgot to suggest they try the right-click menu on the Find dropdown, to quickly recall a saved search or add the current one to the saved searches...
![]() |
![]() |
![]() |
![]() |
#146 |
eBook FANatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 18,301
Karma: 16078357
Join Date: Apr 2008
Location: Alabama, USA
Device: HP ipac RX5915 Wife's Kindle
|
Finding strings only contained in <p>....</p>
Some ebooks capitalize for emphasis and some capitalize all proper names.
The following experssion easily finds all cap words in a file: (\w{Lu}+\w). The problem is that it finds all caps to inclued those in headers and other places where caps are wanted. I have been trying for some time to build a regex that will limit itself the those cap words between <p> tags with no success. Is there a way to do this? |
![]() |
![]() |
![]() |
#147 |
frumious Bandersnatch
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,550
Karma: 19500001
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
Doesn't this work?:
Code:
<p[> ].*(\w{Lu}+\w) (it needs the dot not to match newlines, and it would only find one word per paragraph) In similar cases, I often find it easier to mark someway the words I don't want to match by adding some otherwise unused character (¬ or | are good candidates), then it's easier to match what I do want to match, and I can remove the marking character easily at the end. |
![]() |
![]() |
![]() |
#148 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,731
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
|
A quick and dirty solution would be:
Find:([[:upper:]]{2,})(.*?)</p> Replace:<i>\L\1\E</i>\2</p> This regular expression searches for uppercase words with at least two uppercase letters and will convert them to lower case italics. (For other case transformation examples see my other post). Since this expression will only match one uppercase word per paragraph, you'll have to run it repeatedly if your paragraphs contain multiple uppercase words. Theoretically, it might also miss some uppercase words or match more than one paragraph. I.e. don't use it with Replace All. If this regular expression actually works for you, please do me a favor and upload a fewer books. ![]() |
![]() |
![]() |
![]() |
#149 | |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 475
Karma: 15000
Join Date: Jul 2008
Device: Various and sundry
|
I have a numer of older books that have been through the OCR process and ended up with paragraph breaks in the middle of sentences. In Open Office, I could get almost al of these fixed by using a regex:
Find: \p([a-z]) Replace: \1\2 I don't seem to be able to get a similar function to work in the Find and Replace of Sigil. The HTML code looks like: Quote:
Thanks. |
|
![]() |
![]() |
![]() |
#150 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,731
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
|
I'm sure that there's a more elegant solution, but you could simply search for a paragraph ending in a lowercase letter or a punctuation sign followed by a paragraph starting with a lowercase letter and then join them with a space.
Code:
Find:([[:lower:]],*;*:*)</span></p>\n\n <p class="calibre"><span>([[:lower:]]) Code:
Replace:\1 \2 Last edited by Doitsu; 09-27-2012 at 07:26 PM. |
![]() |
![]() |
![]() |
|
![]() |
||||
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 |