04-04-2012, 07:37 PM | #31 |
Grand Sorcerer
Posts: 28,044
Karma: 199464182
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
I'm assuming you mean:
<span class="fine"> </span> And not: </span class="fine"> </span> |
04-04-2012, 07:46 PM | #32 |
Wizard
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
|
Advert | |
|
04-05-2012, 08:22 AM | #33 |
Guru
Posts: 657
Karma: 64171
Join Date: Sep 2010
Location: Kent, England, Sol 3, ZZ9 plural Z Alpha
Device: Sony PRS-300, Kobo Aura HD, iPad (Marvin)
|
Oops! (wrong topic)
|
04-08-2012, 05:29 AM | #34 |
Wizard
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
Hi
I am not sure I am in the right thread, though it's about regex. I have several regex that I use on my EPUB with Sigil on all html files. For example: F & R 1 <p class="let">([A-Z]) <p class="let"><span class="let1"><span class="let2">\1</span></span> F & R 2 </span></span>((.[^ ]{0,20}[ ]){4}) </span></span><span class="smcpTypeV">\1</span> I would like some advice about the simplest way to chain these two regexes (and presumably more). To play 1 and after 2. Out of building a new program (which is way beyond my abilities), I have absolutely no idea how to do it, but it would be pretty useful for me. |
04-08-2012, 05:57 AM | #35 |
Well trained by Cats
Posts: 30,452
Karma: 58055868
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
not the answer to your chain question, but.
Code:
<p class="let"><span class="let1"><span class="let2">\1</span></span> Code:
<p class="let"><span class="let1 let2">\1</span> |
Advert | |
|
04-08-2012, 06:09 AM | #36 | |
Berti
Posts: 1,197
Karma: 4985964
Join Date: Jan 2012
Location: Zischebattem
Device: Acer Lumiread
|
Quote:
Code:
<p class="let">([A-Z])((.[^ ]{0,20}[ ]){4}) <p class="let"><span class="let1"><span class="let2">\1</span></span><span class="smcpTypeV">\2</span> If iunderstand correctly, you're looking for a word after "<p class="let">", then you format the first letter someway and the rest in an other way, right ? Can you give a text-sample ? |
|
04-08-2012, 06:10 AM | #37 |
Guru
Posts: 657
Karma: 64171
Join Date: Sep 2010
Location: Kent, England, Sol 3, ZZ9 plural Z Alpha
Device: Sony PRS-300, Kobo Aura HD, iPad (Marvin)
|
Are the two </span>'s in the find of the second action the ones put there by the replace of the first action, i.e. you're working on the same paragraph. ?
Edit: (missed mmat1 post, while typing) If it's for first letter stuff, what about if desired paragraph starts with a quotemark of some sort, do you want that taken into consideration? Edit 2: And are all these paragraphs going to have several words, or could some be just 2 or 3 - I see you've got a {4} set in there. Last edited by Perkin; 04-08-2012 at 06:19 AM. |
04-08-2012, 06:30 AM | #38 |
Wizard
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
Thanks for your answers. Some needed comments maybe:
These two regex are about dropcaps, but I have others... FR1 is to deal with the first letter of a paragraph named let (no indent). It begins after <p class="let"> and it creates a double span, finishing with </span></span> after the first capital letter. FR2 specifies the number of words to use after the first letter (here 4). It begins with the characteristic </span></span> and builds itw own span. I have both A et V styles with different margin-left values. @theducks I took good note of your remark. There is no quotemark problem at least for me. When I select a paragraph to have a dropcap, I make sure it begins with a capital letter. :firstletter anyway does not work with ADE so there is no automatic mode for this. text sample coming... Last edited by roger64; 04-08-2012 at 06:58 AM. |
04-08-2012, 06:48 AM | #39 |
Guru
Posts: 657
Karma: 64171
Join Date: Sep 2010
Location: Kent, England, Sol 3, ZZ9 plural Z Alpha
Device: Sony PRS-300, Kobo Aura HD, iPad (Marvin)
|
Without testing, using your regexes from above, and could pobably fine-tune a bit.
Search Code:
<p class="let">([A-Z])((.[^ ]{0,20}[ ]){4}) Code:
<p class="let"><span class="let1 let2">\1</span><span class="smcpTypeV">\2</span> |
04-08-2012, 06:52 AM | #40 |
Wizard
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
I sent the epub with one dropcap but I forgot something, here is a better one with true smallcaps (best seen with ADE)
sorry I test your regex Last edited by roger64; 04-08-2012 at 07:02 AM. |
04-08-2012, 06:58 AM | #41 |
Berti
Posts: 1,197
Karma: 4985964
Join Date: Jan 2012
Location: Zischebattem
Device: Acer Lumiread
|
I've seen it, but meanwhile i tested this:
Code:
<p class="let">([A-Z])(\w{0,20}\s)((\w{0,20}\s){3}) <p class="let"><span class="let1 let2">\1</span><span class="smcpTypeV">\2\3</span> |
04-08-2012, 07:08 AM | #42 |
Wizard
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
@mmat No, getting strange results..
@Perkin No, same as above. Sending the source odt as well Last edited by roger64; 04-08-2012 at 07:13 AM. |
04-08-2012, 07:09 AM | #43 |
Guru
Posts: 657
Karma: 64171
Join Date: Sep 2010
Location: Kent, England, Sol 3, ZZ9 plural Z Alpha
Device: Sony PRS-300, Kobo Aura HD, iPad (Marvin)
|
I've found a problem/difference with replacing once and replacing all, using both my and mmat1's replace strings, when doing a step replace the last space is inside the span, but just doing a replace all, the last space is outside it.
Just posting a report in 0.5.3 release thread. |
04-08-2012, 07:16 AM | #44 |
Berti
Posts: 1,197
Karma: 4985964
Join Date: Jan 2012
Location: Zischebattem
Device: Acer Lumiread
|
|
04-08-2012, 07:18 AM | #45 |
Guru
Posts: 657
Karma: 64171
Join Date: Sep 2010
Location: Kent, England, Sol 3, ZZ9 plural Z Alpha
Device: Sony PRS-300, Kobo Aura HD, iPad (Marvin)
|
Using your epub and concatenating the two let1/2 styles and removing the now extraneous </span>, I get a odd result as well, so it's not the actual regex, it's the css
looking into it. @mmat1, tidy is off, and even if on shouldn't alter that anyway. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Examples of Subgroups | emonti8384 | Lounge | 32 | 02-26-2011 07:00 PM |
Accessories Pen examples | Gunnerp245 | enTourage Archive | 15 | 02-21-2011 04:23 PM |
Stylesheet examples? | Skitzman69 | Sigil | 15 | 09-24-2010 09:24 PM |
Examples | kafkaesque1978 | iRiver Story | 1 | 07-26-2010 04:49 PM |
Looking for examples of typos in eBooks | Tonycole | General Discussions | 1 | 05-05-2010 05:23 AM |