06-11-2011, 08:59 AM | #1 |
Guru
Posts: 753
Karma: 1496807
Join Date: Jul 2008
Location: The Third World
Device: iLiad + PRS-505 + Kindle 3
|
RegExp in search field
The problem: select all authors whose last name begins with "A".
Easy solution: select each one of them form the tag browser (Calibre does not seem to permit the selection from a grouped tag branch). I'm actually looking for a more general solution, so I tried to search with regular expressions, with no luck. The first problem I incurred into is the incredible persistence of previously used searches: the first attempt I made, I accidentally wrote it with a lowercase "a" instead of the capital one. Now, there's no way to use the same expression with the correct case. No matter how I try, Calibre will always get the previous lowercase one. Another annoyance is that whatever I type in the search field after the colon ":" is interpreted as a command. So, when I try to type "author_sort:A" I end up with the "add files dialog". As soon as I remember my password, I'll open a bug for that... Getting back to regular expression, I've used the advanced search function and the search field in the library, with the same result: nothing selected. Here are my attempts: author_sort:A --> I got all the authors with an "A" somewhere in their names (case insensitive) author_sort:^A --> Empty list author_sort:=^A --> Empty list author_sort:"^A" --> Empty list author_sort:="^A" --> Empty list Putting ".+" after the cited RE does not change anything. So, what can I do to restrict the library to authors whose last name begins with a specified letter (or one from a set of such letters)? Thank you for your help! |
06-11-2011, 09:42 AM | #2 |
Calibre Plugins Developer
Posts: 4,637
Karma: 2162064
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
|
author_sort:"~^A.*"
Use Preferences->Searching to clear your search history |
Advert | |
|
06-11-2011, 02:13 PM | #3 |
Guru
Posts: 753
Karma: 1496807
Join Date: Jul 2008
Location: The Third World
Device: iLiad + PRS-505 + Kindle 3
|
It works, thank you kiwidude.
|
06-12-2011, 06:52 PM | #4 | ||||
Wizard
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
Quote:
fieldname:"~ means use regex fieldname:"= means exact match Quote:
2) FYI, searches are case insensitive 3) I dislike the search as you type option - it can be turned off in Preferences Quote:
Quote:
|
||||
06-13-2011, 11:00 AM | #5 |
Guru
Posts: 753
Karma: 1496807
Join Date: Jul 2008
Location: The Third World
Device: iLiad + PRS-505 + Kindle 3
|
Thank you everybody.
I missed the tilde for the input of regexp... |
Advert | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Search Replcae error on custom field | adept22 | Library Management | 4 | 03-14-2011 09:47 AM |
Variable Search, Replace & Transfer to a new field | flopis | Library Management | 10 | 03-09-2011 11:41 AM |
Is this as it supposed to be? (Regexp issue?) | Mixx | Calibre | 13 | 03-09-2011 03:30 AM |
Multiple line regexp | janvanmaar | Calibre | 19 | 11-02-2010 01:02 PM |
Regex search author field to locate books? | Starson17 | Calibre | 2 | 12-21-2009 10:40 AM |