Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 06-10-2012, 07:36 AM   #1
Jabby
Jr. - Junior Member
Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.
 
Posts: 586
Karma: 2000358
Join Date: Aug 2010
Location: Alabama
Device: Archos, Asus, HP, Lenovo, Nexus and Samsung tablets in 7,8 and 10"
Regex F&R problem?

I had noticed in the past that the regex count and replace numbers didn't always match and decided to look into it.

The reason for this disparity is that the count notes each instance of the regex match while the replace function replaces only the first match in any given paragraph. Ergo, the count difference. This is not true for a "normal" F&R.

No big problem if you are aware of this anomaly. Just re-run the F&R until none are replaced.

I hope this isn't old hat but I haven't seen anything on it and a search didn't turn up anything.

Regards - John
Jabby is offline   Reply With Quote
Old 06-10-2012, 08:07 AM   #2
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,583
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
It's possible that the regular expression that you used caused the problem and not Sigil. Can you give us examples of specific regular search expressions that you used and the texts that you used it with?
Doitsu is offline   Reply With Quote
Advert
Old 06-10-2012, 08:31 AM   #3
Jabby
Jr. - Junior Member
Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.
 
Posts: 586
Karma: 2000358
Join Date: Aug 2010
Location: Alabama
Device: Archos, Asus, HP, Lenovo, Nexus and Samsung tablets in 7,8 and 10"
Quote:
Originally Posted by Doitsu View Post
It's possible that the regular expression that you used caused the problem and not Sigil. Can you give us examples of specific regular search expressions that you used and the texts that you used it with?
I'll dig one up and get back.

Regards - John
Jabby is offline   Reply With Quote
Old 06-10-2012, 10:10 AM   #4
Jabby
Jr. - Junior Member
Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.
 
Posts: 586
Karma: 2000358
Join Date: Aug 2010
Location: Alabama
Device: Archos, Asus, HP, Lenovo, Nexus and Samsung tablets in 7,8 and 10"
More F&R info

First things first. This is an amended version the first paragraph of my original post which should read:

I had noticed in the past that the normal count and regex count numbers didn't always match and decided to look into it.

Using the attached file, count the number of calibre9 and you will get of 120. The same with <em class="calibre9">. Using the regex terms below you will get a count and a replace count of 90.

Code:
<em class="calibre9">(.*)</em>
<span class="italic">\1</span>
Execute another replace using the same terms same and you wiil get a count of 18. At this point 108 changes have been made.

Go to line 102 of chapter 12 and you will find five instances of the terms in question. The first two have been changed the remaining three remain the same.

Regards - John
Attached Files
File Type: epub Test-Tarzan and the Lion-Man.epub (244.9 KB, 146 views)
Jabby is offline   Reply With Quote
Old 06-10-2012, 11:48 AM   #5
meme
Sigil developer
meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.
 
Posts: 1,275
Karma: 1101600
Join Date: Jan 2011
Location: UK
Device: Kindle PW, K4 NT, K3, Kobo Touch
Try:

Find:
Code:
<em class="calibre9">(.*?)</em>
or

Code:
(?U)<em class="calibre9">(.*)</em>
meme is offline   Reply With Quote
Advert
Old 06-10-2012, 12:23 PM   #6
Jabby
Jr. - Junior Member
Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.
 
Posts: 586
Karma: 2000358
Join Date: Aug 2010
Location: Alabama
Device: Archos, Asus, HP, Lenovo, Nexus and Samsung tablets in 7,8 and 10"
Quote:
Originally Posted by meme View Post
Try:

Find:
Code:
<em class="calibre9">(.*?)</em>
or

Code:
(?U)<em class="calibre9">(.*)</em>
Ah so!

As the old Yiddish (maybe) saying goes, "too soon old, too late smart".

Regards - John
Jabby is offline   Reply With Quote
Old 06-12-2012, 04:18 AM   #7
Hitch
Bookmaker & Cat Slave
Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.
 
Hitch's Avatar
 
Posts: 11,460
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
Jabbers:

FWIW--I believe that's actually Amish. I could be misremembering--those ol' brain cells aren't firing on all the cylinders as they did when erewhile I was young; but, I think that's right. ;-)

Hitch
Hitch is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Regex: File Renaming Pre-Import & Importing penguinaka Library Management 20 08-14-2012 06:11 PM
RegEx & Unicode capnm Library Management 14 12-01-2011 08:23 PM
Search & Replace/Regex help!! millertime13 Conversion 4 07-22-2011 02:40 AM
Regex Problem huebi Sigil 3 05-10-2011 04:32 AM
CSS & regex for chapter titles hpstricker Calibre 3 07-17-2008 10:13 AM


All times are GMT -4. The time now is 12:08 AM.


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