|
|
#1 |
|
Connoisseur
![]() ![]() ![]() Posts: 74
Karma: 200
Join Date: Nov 2010
Location: Dortmund, Germany
Device: Sony PRS-T1, HP Pre³, TouchPad
|
Case Sensitive Regular Expression
the manual stated that regular expressions in calibre are treated as case sensitive, but i noticed a few cases where this is not true. e.g. the re() function and the search. Sadly python does not allow activating case sensitivity in a regexp, i.e. (?-i) does not work. I'm mentioning this for two reasons. 1) Maybe the manual should be updated to reflect those changes and 2) it would be nice to somehow use case sensitive regexp. For templates I created my own function to do so, for searching it seems impossible. the search field does not even let me enter the same query with a different case. I know most of the time it's not needed but it would have been useful to me right now so I thought I'd mention it. |
|
|
|
|
|
#2 | |||
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,853
Karma: 285886
Join Date: Jan 2010
Location: France
Device: Sony PRS-300, HTC WM6.5, Samsung Galaxy Nexus, HTC Sensation
|
Quote:
Quote:
Quote:
__________________
Support calibre developers at no cost to you by using calibre's get books feature. Use Calibre Companion to wirelessly connect your Android phone or tablet to calibre charles.haleys.org/calibre |
|||
|
|
|
|
Enthusiast
|
|
|
|
#3 |
|
Connoisseur
![]() ![]() ![]() Posts: 74
Karma: 200
Join Date: Nov 2010
Location: Dortmund, Germany
Device: Sony PRS-T1, HP Pre³, TouchPad
|
I created an emergency solution for myself, just in case, that I'm currently not using but in case someone else wants something like this: i created template functions for contains and re that are case sensitive (mainly just removing the flag from the predefined ones) and then if i need to search something case sensitive, i use the custom column as a flag. not elegant, seems slower, but works...
I was talking about http://manual.calibre-ebook.com/regexp.html, it talks extensively about regex being case sensitive and how to switch it of, etc. All in all I agree, best to just leave it case insensitive, to few use cases to put work into it
|
|
|
|
![]() |
| Thread Tools | Search this Thread |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Regular Expression Help | Azhad | Calibre | 86 | 09-27-2011 02:37 PM |
| Regular Expression Help | iKarampa | Calibre | 13 | 12-15-2010 07:17 AM |
| Regular expression help | krendk | Calibre | 4 | 12-04-2010 04:32 PM |
| Regular Expression Help | smartmart | Calibre | 5 | 10-17-2010 05:19 AM |
| Help with the regular expression | Dysonco | Calibre | 9 | 03-22-2010 10:45 PM |