09-20-2010, 08:56 AM | #61 | |
Wizard
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
Quote:
Next up - the scripting language: Code:
If (contents of field1 are 'XXXX"): Change field2 to "YYYY-XXX" Actually, I have a question about the quoted portion for regular searching (not the new advanced S&R). AFAICT, all Search Box searches are now case insensitive. There are times when I want to do "Text mode -- case sensitive" searches. Is there a way to do that now? If not, it would be useful to have a switch or checkbox for the regex search box to not ignore case or just a simple pull down option hidden away in the Advanced Search dialog for "Text mode -- case sensitive". For your consideration. |
|
09-20-2010, 12:23 PM | #62 | ||
Grand Sorcerer
Posts: 11,742
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Quote:
It wouldn't be hard to provide a tweak that would make all the history comboboxes case sensitive. It would be much more if a bother to do them individually. Boxes where it really should work one way or the other (like S/R) could set the behavior explicitly. I have finished the latest effort and submitted it to Kovid. The attached screen shot shows what it looks like in regexp mode. In character mode the 'destination' line of controls goes away. You will see that I did not do general templates, but instead provide for explicit source and destination fields. Handing multiplicity was simply too hard in the template case. |
||
Advert | |
|
09-20-2010, 02:04 PM | #63 | ||
Wizard
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
Quote:
Quote:
On the case sensitivity issue for general searching, the fact that S&R can do case sensitive searches will actually make it more likely that I'll want case sensitive regular searches. Before running a regex in S&R, I've been running it in the regular search. It helps give me a better idea of what odd cases may crop up in a case sensitive S&R before actually committing to it. It also helps give me more control over the selected files that the S&R will be applied to. There's no point in selecting more books for the bulk metadata edit than you know need to get changed. Without case sensitivity in regular searches, you may have to select all books, even if you only want to change some that have a certain case problem in the fields. (Last - congrats on getting the new custom column release into beta. I hope to look it over soon.) |
||
09-20-2010, 02:13 PM | #64 | |
Grand Sorcerer
Posts: 11,742
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
I have no problem making a tweak that makes regexp searches case sensitive. It cannot be on by default, but for those who want it, fine. I just glanced at the search code. It is doable. If you set the tweak, you would be required to use the (?i) notation if you want case-insensitive matching. [QUOTE (Last - congrats on getting the new custom column release into beta. I hope to look it over soon.)[/QUOTE]I hope it works well for you. |
|
09-20-2010, 02:31 PM | #65 | ||
Wizard
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
Quote:
Quote:
|
||
Advert | |
|
09-20-2010, 02:39 PM | #66 |
creator of calibre
Posts: 43,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
why not just use the case sensitive checkbox to control if the regex is case sensitive or not.
And make the history matching case sensitive for the search and replace boxes. |
09-20-2010, 03:02 PM | #67 | |
Grand Sorcerer
Posts: 11,742
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Starson17 is talking about the standard search (the library search box), which is hardwired to be case insensitive. There is no easy way to pass an option along with a search, so a checkbox on advanced search won't work. I could use (?I) to invert the flag and also not do the source_text.lower() before applying the pattern, but that is a non-standard flag. It doesn't mean anything else, so it would work. It is unfortunate that python does not have the ability to invert case sensitivity in the middle of the regexp. @starson17: python does not use the perl syntax '/i'. It uses (?iLmsux), where the letters specify the flag to be applied. The documentation is Code:
(One or more letters from the set 'i', 'L', 'm', 's', 'u', 'x'.) The group matches the empty string; the letters set the corresponding flags: re.I (ignore case), re.L (locale dependent), re.M (multi-line), re.S (dot matches all), re.U (Unicode dependent), and re.X (verbose), for the entire regular expression. (The flags are described in Module Contents.) This is useful if you wish to include the flags as part of the regular expression, instead of passing a flag argument to the re.compile() function. |
|
09-20-2010, 03:09 PM | #68 |
creator of calibre
Posts: 43,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
What's the use case for case sensitive searching in the main search box?
|
09-20-2010, 05:01 PM | #69 | |
Wizard
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
Quote:
2) It might also prove useful for those who've run into problems when dual booting a case sensitive vs. case insensitive OS. I've been struggling with the errors in case a lot. 3) Before doing a case sensitive S&R, it'd be useful to do a case sensitive main search. I don't want to select any more records than I have to before applying the new bulk metadata edit. (Although this case may boil down to the two above). |
|
09-20-2010, 05:03 PM | #70 |
Grand Sorcerer
Posts: 11,742
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
@kovid: note that he is talking about case-sensitive regexps from the search bar, not general text-match searches.
|
09-20-2010, 05:07 PM | #71 |
creator of calibre
Posts: 43,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Ah, I see. Yeah you'd need extra UI to do this.
|
09-21-2010, 09:11 AM | #72 | |
Wizard
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
Quote:
http://docs.python.org/library/re.html#re-syntax |
|
09-22-2010, 04:51 AM | #73 |
Wizard
Posts: 3,130
Karma: 91256
Join Date: Feb 2008
Location: Germany
Device: Cybook Gen3
|
This is the official thread for discussion of the new S&R- feature, right? It's a great feature, I only have one question: In the series field, is it possible to access the series index? I like to have books that are part of a series named as "<series> <series_index> - <title>" and tried to accomplish that automatically, but I couldn't get the index to appear.
(Edit: I'm aware that I could do this in the send to device- preferences. But I'm using tags to specify on-device folders and, quite simply, I'm too lazy to change all that ) |
09-22-2010, 06:34 AM | #74 | |
Grand Sorcerer
Posts: 11,742
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
In any event, you get one source field and one destination field. Both must be text type. It sounds like you want two source fields, series and series_index? Or perhaps even three: title, series, and series index? This was what the 'input template' was for. As noted above, I didn't end up building that because of problems with multiple-value columns (tags, for example). The tags source field is not the same as a template containing {tags}. In the tags==source case, the expression is applied on a tag-by-tag basis. In the template case, the expression would be applied once across the entire set of tags. It it hard to explain the two different behaviors. Do I have votes? Should the template be provided, even though {tags} is not the same as the 'tags' source field? |
|
09-22-2010, 06:44 AM | #75 | |
US Navy, Retired
Posts: 9,864
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
|
Quote:
|
|
Tags |
metadata, replace, search |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
CALIBRE WILL NOT RECOGNISE TITLES OR AUTHORS | D.. | Calibre | 5 | 09-14-2010 09:33 PM |
Classic PDF titles and authors on nook? | slothrop | Barnes & Noble NOOK | 2 | 12-09-2009 09:23 PM |
Issues Editing Titles & Authors | kmvargo | Calibre | 0 | 07-05-2009 12:43 AM |
Authors/Titles different font sizes | bunjibear | Sony Reader | 6 | 03-15-2009 10:41 AM |
Changes in Titles/Authors Not Shown | Ralob | Bookeen | 20 | 04-07-2008 08:16 AM |