Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 02-28-2020, 02:11 AM   #1
The_book
Zealot
The_book began at the beginning.
 
Posts: 100
Karma: 10
Join Date: Aug 2019
Device: none
Two advices on Sigil's "Find & Replace".

After reading Scripted "Find & Replace"? and using Sigil, now I have two advides on Sigil's "Find & Replace".
First, "Case Sensitive" can be a opintion like DotAll and Wrap. It is not an independent mode. In "Normal" or "Regex" we can both have "Case Sensitive".
Second, "Saved Searches" can save more than now, saving the opintions like "Normal" or "Regex", DotAll and Wrap, or left blank, which means do not change the "Find & Replace" mode.
The_book is offline   Reply With Quote
Old 02-28-2020, 07:24 AM   #2
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,343
Karma: 203719646
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Your first suggestion already exists. "Normal" is case-insensitive, and "Case Sensitive" is (Normal) Case Sensitive. Regex is case-sensitive by default, but has its own case-insensitivity option built into it. Why would we reinvent that particular wheel? So yes... you already have complete and independent control over case (in)sensitivity in both modes.

Last edited by DiapDealer; 02-28-2020 at 08:33 AM.
DiapDealer is online now   Reply With Quote
Advert
Old 02-28-2020, 08:19 AM   #3
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,343
Karma: 203719646
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
As for the second suggestion, it's not a question of how easily it could be implemented. It's a question of how best to explain to users with extensive Saved Search libraries that we broke them. Introducing new fields would be next to impossible to do while maintaining backward compatibility with existing SS libraries. Meaning we run the risk of potentially damaging existing libraries (at the extreme), or at the very least, tell users that they need to manually massage their existing preference files to work with the new format that will be required to store more fields per saved-search entry.

I'm sure that some ways around the backward compatibility issue could be found, but the point is that it's a huge factor when considering how to implement such a feature expansion.

Last edited by DiapDealer; 02-28-2020 at 08:59 AM.
DiapDealer is online now   Reply With Quote
Old 02-28-2020, 08:49 PM   #4
The_book
Zealot
The_book began at the beginning.
 
Posts: 100
Karma: 10
Join Date: Aug 2019
Device: none
Quote:
Originally Posted by DiapDealer View Post
Your first suggestion already exists. "Normal" is case-insensitive, and "Case Sensitive" is (Normal) Case Sensitive. Regex is case-sensitive by default, but has its own case-insensitivity option built into it. Why would we reinvent that particular wheel? So yes... you already have complete and independent control over case (in)sensitivity in both modes.
Regex has its own case-insensitivity option built into it.
Sorry for I know nothing about this. Where is the opinion?
And it is for readable, I think. Nromal compare to Regex, and they both have a case-sensitive opinion. I think it's more intuitive。
The_book is offline   Reply With Quote
Old 02-28-2020, 08:55 PM   #5
The_book
Zealot
The_book began at the beginning.
 
Posts: 100
Karma: 10
Join Date: Aug 2019
Device: none
Quote:
Originally Posted by DiapDealer View Post
As for the second suggestion, it's not a question of how easily it could be implemented. It's a question of how best to explain to users with extensive Saved Search libraries that we broke them. Introducing new fields would be next to impossible to do while maintaining backward compatibility with existing SS libraries. Meaning we run the risk of potentially damaging existing libraries (at the extreme), or at the very least, tell users that they need to manually massage their existing preference files to work with the new format that will be required to store more fields per saved-search entry.

I'm sure that some ways around the backward compatibility issue could be found, but the point is that it's a huge factor when considering how to implement such a feature expansion.
I know now, I may go ot see the sourse code to check it.
The_book is offline   Reply With Quote
Advert
Old 02-29-2020, 07:55 AM   #6
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,343
Karma: 203719646
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by The_book View Post
Regex has its own case-insensitivity option built into it.
Sorry for I know nothing about this. Where is the opinion?
And therein lies the problem. If you knew more about regex, you would already know why there's not going to be any checkbox to make a regexp case-insensitive. (?i) makes a regular expression case-insensitive.

Quote:
Originally Posted by The_book View Post
And it is for readable, I think. Nromal compare to Regex, and they both have a case-sensitive opinion. I think it's more intuitive。
Not going to happen. I'm not going to waste time trying to make regex more "intuitive" for people who don't know regex.

As already mentioned, you already have complete and independent control over case sensitivity in both normal and regex modes. You don't need features added to Sigil. You just need to become more fluent with regex.

https://www.regular-expressions.info/
DiapDealer is online now   Reply With Quote
Old 02-29-2020, 09:55 AM   #7
The_book
Zealot
The_book began at the beginning.
 
Posts: 100
Karma: 10
Join Date: Aug 2019
Device: none
Quote:
Originally Posted by DiapDealer View Post
And therein lies the problem. If you knew more about regex, you would already know why there's not going to be any checkbox to make a regexp case-insensitive. (?i) makes a regular expression case-insensitive.


Not going to happen. I'm not going to waste time trying to make regex more "intuitive" for people who don't know regex.

As already mentioned, you already have complete and independent control over case sensitivity in both normal and regex modes. You don't need features added to Sigil. You just need to become more fluent with regex.

https://www.regular-expressions.info/
Ok. It's just I uesd to use regex in javascript or python, which have a flag argument which can control case sensitivity, DotAll or other things. So I think case sensitivity is a opinion like DotAll and I don't know to use (?i).
And now I learn it. Thank you.
The_book is offline   Reply With Quote
Old 02-29-2020, 12:44 PM   #8
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,343
Karma: 203719646
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
You can also use (?-i) to disable case insensitivity. PCRE regex makes it possible to apply/remove case (in)sensitivity to portions of regex expressions. Meaning one could have case sensitive and case insensitive portions in the same expression. Which means that advanced regex users would actually have to sacrifice functionality if a simple on/off option were used to control regex case (in)sensitivity.

Last edited by DiapDealer; 03-01-2020 at 05:34 AM.
DiapDealer is online now   Reply With Quote
Old 02-29-2020, 06:10 PM   #9
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 2,306
Karma: 13057279
Join Date: Jul 2012
Device: Kobo Forma, Nook
Quote:
Originally Posted by The_book View Post
It's just I uesd to use regex in javascript or python, which have a flag argument which can control case sensitivity, DotAll or other things. So I think case sensitivity is a opinion like DotAll and I don't know to use (?i).
And now I learn it. Thank you.
Calibre Editor's "Case Insensitive" applies to Regex searches.

So this text:

Code:
This is a test Case case.
with this Regex:

Code:
[c]ase
By default, Sigil/Calibre will only match lowercase "case".

If you check the Case Insensitive box, Calibre matches both "Case" and "case". (I haven't looked in source, but I assume Calibre secretly adds (?i) to the Regex if the box is checked?)
Tex2002ans is offline   Reply With Quote
Old 03-01-2020, 05:48 AM   #10
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,343
Karma: 203719646
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Calibre typically uses the Barnett regex Python module (where Sigil uses PCRE). I don't know if the Barnett module allows the granular use of the case insensitive flag to control portions of expressions or not (the standard python re module does not). I think it depends on how the module is compiled. If it doesn't, a global "switch" makes more sense.
DiapDealer is online now   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Scripted "Find & Replace"? beiti Sigil 15 02-28-2020 09:14 PM
Default "find" for Search/Replace regex functions vr8ce Editor 14 02-02-2018 10:41 AM
Find / Replace does not respect "down" setting DrChiper Editor 24 01-26-2014 06:10 PM
MS Word Find & Replace and "Smart" quotes question. Ahu Lee Workshop 1 01-14-2013 11:02 AM
timefmt, align="center", find replace Kirk Vomit Recipes 0 04-11-2012 05:03 AM


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


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