Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 04-04-2012, 06:37 PM   #31
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,467
Karma: 192992430
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
I'm assuming you mean:
<span class="fine">&nbsp;</span>

And not:
</span class="fine">&nbsp;</span>
DiapDealer is online now   Reply With Quote
Old 04-04-2012, 06:46 PM   #32
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
Quote:
Originally Posted by DiapDealer View Post
I'm assuming you mean:
<span class="fine">&nbsp;</span>

And not:
</span class="fine">&nbsp;</span>
shame on me. Thanks.
roger64 is offline   Reply With Quote
Advert
Old 04-05-2012, 07:22 AM   #33
Perkin
Guru
Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.
 
Perkin's Avatar
 
Posts: 655
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)
Perkin is offline   Reply With Quote
Old 04-08-2012, 04:29 AM   #34
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
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.
roger64 is offline   Reply With Quote
Old 04-08-2012, 04:57 AM   #35
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,689
Karma: 54369090
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>
can be written as

Code:
<p class="let"><span class="let1 let2">\1</span>
theducks is offline   Reply With Quote
Advert
Old 04-08-2012, 05:09 AM   #36
mmat1
Berti
mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.
 
mmat1's Avatar
 
Posts: 1,196
Karma: 4985964
Join Date: Jan 2012
Location: Zischebattem
Device: Acer Lumiread
Quote:
Originally Posted by roger64 View Post
I would like some advice about the simplest way to chain these two regexes (and presumably more). To play 1 and after 2.
I'll try a shot

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>
It's not tested though, and there are nested () which should be \2.

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 ?
mmat1 is offline   Reply With Quote
Old 04-08-2012, 05:10 AM   #37
Perkin
Guru
Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.
 
Perkin's Avatar
 
Posts: 655
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 05:19 AM.
Perkin is offline   Reply With Quote
Old 04-08-2012, 05:30 AM   #38
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
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 05:58 AM.
roger64 is offline   Reply With Quote
Old 04-08-2012, 05:48 AM   #39
Perkin
Guru
Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.
 
Perkin's Avatar
 
Posts: 655
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})
Replace
Code:
<p class="let"><span class="let1 let2">\1</span><span class="smcpTypeV">\2</span>
Perkin is offline   Reply With Quote
Old 04-08-2012, 05:52 AM   #40
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
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
Attached Files
File Type: epub essai.epub (62.8 KB, 1026 views)

Last edited by roger64; 04-08-2012 at 06:02 AM.
roger64 is offline   Reply With Quote
Old 04-08-2012, 05:58 AM   #41
mmat1
Berti
mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.
 
mmat1's Avatar
 
Posts: 1,196
Karma: 4985964
Join Date: Jan 2012
Location: Zischebattem
Device: Acer Lumiread
Quote:
Originally Posted by roger64 View Post
I sent the epub with one dropcap.
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>
It handles the first 4 words of an "let"-paragraph. (Perkins suggestion built in) Maybe you give it a try.
mmat1 is offline   Reply With Quote
Old 04-08-2012, 06:08 AM   #42
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
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
Attached Files
File Type: zip essai.odt.zip (23.8 KB, 799 views)

Last edited by roger64; 04-08-2012 at 06:13 AM.
roger64 is offline   Reply With Quote
Old 04-08-2012, 06:09 AM   #43
Perkin
Guru
Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.
 
Perkin's Avatar
 
Posts: 655
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.
Perkin is offline   Reply With Quote
Old 04-08-2012, 06:16 AM   #44
mmat1
Berti
mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.
 
mmat1's Avatar
 
Posts: 1,196
Karma: 4985964
Join Date: Jan 2012
Location: Zischebattem
Device: Acer Lumiread
Quote:
Originally Posted by Perkin View Post
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.
It's maybe just tidy ??
mmat1 is offline   Reply With Quote
Old 04-08-2012, 06:18 AM   #45
Perkin
Guru
Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.
 
Perkin's Avatar
 
Posts: 655
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.
Perkin is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

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


All times are GMT -4. The time now is 10:37 AM.


MobileRead.com is a privately owned, operated and funded community.