Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 05-18-2025, 05:06 AM   #16
philja
Addict
philja will become famous soon enoughphilja will become famous soon enoughphilja will become famous soon enoughphilja will become famous soon enoughphilja will become famous soon enoughphilja will become famous soon enough
 
Posts: 237
Karma: 516
Join Date: Nov 2015
Location: Europe EEC
Device: Kindle Fire HD6 & HD8
I'm always interested in expanding my use of regex so I tried both Doitsu's test case and Kevin's test case and couldn't get either to work in Sigil 2.4.2 on my MacBook.

Doitsu's original Find
Code:
(?<!”\s\w+\s)said\. “
and

Kevin's variation :
Code:
(?<!”\s\w{1,6}\s)said\. “
both give 'Invalid Regex: offset:0' when I hover on them as does Kevin's other test case
Code:
(?<=0x{1,6})y
Presumably, these should work in 2.4.2 on Mac?

Edit:
I must be seriously missing something. I can't get any of these 3 regex Finds to work on my linux or W10 boxes either.

Hovering the cursor over the find term gives exactly the same message each time: 'Invalid Regex: offset:0' which doesn't help me at all.

I can get both
Code:
(?<!"\sJack\s)said\. "   and   (?<!"\s\w{4}\s)said\. "
to work with Diatsu's test epub ie it ignores his first line and finds the other two. But as soon as I mess around trying to use a range {1,6} or similar, the regex is described as invalid.

Last edited by philja; 05-18-2025 at 08:41 AM. Reason: further testing
philja is offline   Reply With Quote
Old 05-18-2025, 08:25 AM   #17
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,616
Karma: 5703586
Join Date: Nov 2009
Device: many
Yes all 3 systems are using PCRE2 10.44 or earlier which have the bug. The next Sigil will use PCRE2 10.45.

On Linux, you should be easily able to update just the PCRE2 library to version 10.45 and Sigil 2.4.2 should work just fine with these tests then.
KevinH is online now   Reply With Quote
Old 05-18-2025, 08:33 AM   #18
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: 28,509
Karma: 204127028
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Can confirm that the Arch repo version of Sigil 2.4.2 doesn't have the bug--as it's built to use the system version of pcre2 (which is 10.45). If you build your own Sigil 2.4.2 with bundled libs (the default) the bug will manifest.
DiapDealer is offline   Reply With Quote
Old 05-18-2025, 09:00 AM   #19
philja
Addict
philja will become famous soon enoughphilja will become famous soon enoughphilja will become famous soon enoughphilja will become famous soon enoughphilja will become famous soon enoughphilja will become famous soon enough
 
Posts: 237
Karma: 516
Join Date: Nov 2015
Location: Europe EEC
Device: Kindle Fire HD6 & HD8
Quote:
Originally Posted by KevinH View Post
Yes all 3 systems are using PCRE2 10.44 or earlier which have the bug. The next Sigil will use PCRE2 10.45.

On Linux, you should be easily able to update just the PCRE2 library to version 10.45, and Sigil 2.4.2 should work just fine with these tests then.
Just checked in my UbuntuStudio 24.04.02 LTS and all pcre2 packages in the repo seem to be 10.42, so it looks like waiting for the next version of Sigil.
philja is offline   Reply With Quote
Old 05-18-2025, 09:48 AM   #20
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: 28,509
Karma: 204127028
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
You built your own version of Sigil on 24.04, (I don't believe sigil 2.4.2 is available for 24.04), right? If so, there's no need to wait for anything. Just build Sigil from the latest GitHub master source and don't configure it to use the system libs. That way it will be built with the pcre2 10.45 now bundled with Sigil.

Ubuntu 24.04 won't likely be upgrading their version of pcre2, so you're going to need to remember to not use -DUSE_SYSTEM_LIBS=1 when configuring Sigil--whenever you build Sigil.
DiapDealer is offline   Reply With Quote
Old 05-18-2025, 12:49 PM   #21
ElMiko
Evangelist
ElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileRead
 
ElMiko's Avatar
 
Posts: 411
Karma: 65460
Join Date: Jun 2011
Device: Kindle
Just a pointless sidebar that was probably addressed 5 years ago with the release of 1.0, thank you for adding the Regex validation into the program, and making it sensitive not to external regex rules but to Sigil's compatibility. Otherwise we'd have been spinning our wheels a lot longer even after landing on nominally valid regex like:

Code:
(?<!”\s\w{1,6}\s)said\. “
Although my decade-overdue upgrade to 2.4.2 seems to have produced a lot of panicked screeching from me in the last couple of weeks, I swear 1) I'm not as panicked as it may seem, and 2) I'm increasingly sympathetic to the view that once you go 2.4.2, you can't go back.
ElMiko is offline   Reply With Quote
Old 05-18-2025, 01:13 PM   #22
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,706
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by philja View Post
I'm always interested in expanding my use of regex so I tried both Doitsu's test case [...]
Both you and ElMiko apparently missed the following:
  • I wrote a simple Sigil regex search plugin
  • That plugin supports a third-party Python regex library called "regex"
  • The regex Python library supports variable-length lookbehínds
  • I.e. the plugin could be used as a stop-gap measure.
    (It'll search all files selected in the book browser and display the matches in the validation´window.)
Doitsu is offline   Reply With Quote
Old 05-18-2025, 01:57 PM   #23
philja
Addict
philja will become famous soon enoughphilja will become famous soon enoughphilja will become famous soon enoughphilja will become famous soon enoughphilja will become famous soon enoughphilja will become famous soon enough
 
Posts: 237
Karma: 516
Join Date: Nov 2015
Location: Europe EEC
Device: Kindle Fire HD6 & HD8
Quote:
Originally Posted by DiapDealer View Post
You built your own version of Sigil on 24.04, (I don't believe sigil 2.4.2 is available for 24.04), right? If so, there's no need to wait for anything. Just build Sigil from the latest GitHub master source and don't configure it to use the system libs. That way it will be built with the pcre2 10.45 now bundled with Sigil.

Ubuntu 24.04 won't likely be upgrading their version of pcre2, so you're going to need to remember to not use -DUSE_SYSTEM_LIBS=1 when configuring Sigil--whenever you build Sigil.
You're so persuasive !! I was so far down this rabbit hole that, after saying Howdo! to Alice, I took up your suggestion and rebuilt Sigil from the latest Master.

The regex problem has now gone on my Linux box - (and I even remembered that testplugin has to used on Sigil's default empty file!!).

Thanks for the push.
philja is offline   Reply With Quote
Old 05-18-2025, 01:59 PM   #24
philja
Addict
philja will become famous soon enoughphilja will become famous soon enoughphilja will become famous soon enoughphilja will become famous soon enoughphilja will become famous soon enoughphilja will become famous soon enough
 
Posts: 237
Karma: 516
Join Date: Nov 2015
Location: Europe EEC
Device: Kindle Fire HD6 & HD8
Quote:
Originally Posted by Doitsu View Post
Both you and ElMiko apparently missed the following:
  • I wrote a simple Sigil regex search plugin
  • That plugin supports a third-party Python regex library called "regex"
  • The regex Python library supports variable-length lookbehínds
  • I.e. the plugin could be used as a stop-gap measure.
    (It'll search all files selected in the book browser and display the matches in the validation´window.)
Not missed. I just got more hooked up to rebuilding on Linux. I'll follow up with your suggestion for my other machines. Thanks.
philja is offline   Reply With Quote
Old 05-18-2025, 02:17 PM   #25
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: 28,509
Karma: 204127028
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by philja View Post
You're so persuasive !! I was so far down this rabbit hole that, after saying Howdo! to Alice, I took up your suggestion and rebuilt Sigil from the latest Master.

The regex problem has now gone on my Linux box - (and I even remembered that testplugin has to used on Sigil's default empty file!!).

Thanks for the push.
Practice does everybody good!

For all intents and purposes, you now have what will be the upcoming Sigil 2.5.0 release. So unless something comes up this week, you won't need to rebuild after the upcoming release.
DiapDealer is offline   Reply With Quote
Old 05-18-2025, 02:56 PM   #26
philja
Addict
philja will become famous soon enoughphilja will become famous soon enoughphilja will become famous soon enoughphilja will become famous soon enoughphilja will become famous soon enoughphilja will become famous soon enough
 
Posts: 237
Karma: 516
Join Date: Nov 2015
Location: Europe EEC
Device: Kindle Fire HD6 & HD8
Quote:
Originally Posted by Doitsu View Post
Both you and ElMiko apparently missed the following:
  • I wrote a simple Sigil regex search plugin
  • That plugin supports a third-party Python regex library called "regex"
  • The regex Python library supports variable-length lookbehínds
  • I.e. the plugin could be used as a stop-gap measure.
    (It'll search all files selected in the book browser and display the matches in the validation´window.)
I tried your plugin on my MacBook with success against the tests specified earlier in this thread.

My main problem was watching plugin runner's blue button oscillating backwards and forwards for several minutes before I remembered that you said something about having to select the regex engine.

I couldn't find where to make that selection. I finally tracked down a postage-stamp-sized GUI which had opened behind the main Sigil window.

Once I entered the regex in that gui, it worked well.

I've tried several times on my MacBook, and that little gui always hides away behind the main window.
philja is offline   Reply With Quote
Old 05-18-2025, 03:07 PM   #27
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: 28,509
Karma: 204127028
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
HighDPI scaling on Linux and macOS retina scaling do terrible things to tkinter widgets. Not only are they often tiny, but they'll only match the system light/dark theme on macOS.
DiapDealer is offline   Reply With Quote
Old 05-19-2025, 05:46 PM   #28
ElMiko
Evangelist
ElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileRead
 
ElMiko's Avatar
 
Posts: 411
Karma: 65460
Join Date: Jun 2011
Device: Kindle
@Doitsu - Sorry 'bout that! You're right; i misunderstood. I thought your plugin was a straight regex validation tool. I didn't understand from your post that it was also a functional search/replace module.
ElMiko is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Battery length ORLOV General Discussions 22 07-28-2011 04:14 PM
Which length of fiction? crich70 Writers' Corner 12 06-03-2011 06:27 PM
File length in MB only clockmaker Calibre 1 07-20-2010 10:35 AM
.7.5 - Zero Length Zips edbro Calibre 2 06-27-2010 05:22 PM
length of ebooks? poshm Writers' Corner 20 11-17-2009 10:30 AM


All times are GMT -4. The time now is 02:45 PM.


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