Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 06-11-2011, 08:59 AM   #1
Format C:
Guru
Format C: ought to be getting tired of karma fortunes by now.Format C: ought to be getting tired of karma fortunes by now.Format C: ought to be getting tired of karma fortunes by now.Format C: ought to be getting tired of karma fortunes by now.Format C: ought to be getting tired of karma fortunes by now.Format C: ought to be getting tired of karma fortunes by now.Format C: ought to be getting tired of karma fortunes by now.Format C: ought to be getting tired of karma fortunes by now.Format C: ought to be getting tired of karma fortunes by now.Format C: ought to be getting tired of karma fortunes by now.Format C: ought to be getting tired of karma fortunes by now.
 
Posts: 753
Karma: 1496807
Join Date: Jul 2008
Location: The Third World
Device: iLiad + PRS-505 + Kindle 3
Question 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!
Format C: is offline   Reply With Quote
Old 06-11-2011, 09:42 AM   #2
kiwidude
Calibre Plugins Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,636
Karma: 2162064
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
author_sort:"~^A.*"

Use Preferences->Searching to clear your search history
kiwidude is offline   Reply With Quote
Advert
Old 06-11-2011, 02:13 PM   #3
Format C:
Guru
Format C: ought to be getting tired of karma fortunes by now.Format C: ought to be getting tired of karma fortunes by now.Format C: ought to be getting tired of karma fortunes by now.Format C: ought to be getting tired of karma fortunes by now.Format C: ought to be getting tired of karma fortunes by now.Format C: ought to be getting tired of karma fortunes by now.Format C: ought to be getting tired of karma fortunes by now.Format C: ought to be getting tired of karma fortunes by now.Format C: ought to be getting tired of karma fortunes by now.Format C: ought to be getting tired of karma fortunes by now.Format C: ought to be getting tired of karma fortunes by now.
 
Posts: 753
Karma: 1496807
Join Date: Jul 2008
Location: The Third World
Device: iLiad + PRS-505 + Kindle 3
It works, thank you kiwidude.
Format C: is offline   Reply With Quote
Old 06-12-2011, 06:52 PM   #4
Starson17
Wizard
Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.
 
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
Quote:
Originally Posted by Format C: View Post
The problem: select all authors whose last name begins with "A".
This was already answered, but in case it's not clear, the first character after fieldname:" tells calibre what to do.
fieldname:"~ means use regex
fieldname:"= means exact match

Quote:
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.
1) You can delete old searches as described above.
2) FYI, searches are case insensitive
3) I dislike the search as you type option - it can be turned off in Preferences

Quote:
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...
Odd. I don't see this.

Quote:
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.
As above - none of those are regexes.
Starson17 is offline   Reply With Quote
Old 06-13-2011, 11:00 AM   #5
Format C:
Guru
Format C: ought to be getting tired of karma fortunes by now.Format C: ought to be getting tired of karma fortunes by now.Format C: ought to be getting tired of karma fortunes by now.Format C: ought to be getting tired of karma fortunes by now.Format C: ought to be getting tired of karma fortunes by now.Format C: ought to be getting tired of karma fortunes by now.Format C: ought to be getting tired of karma fortunes by now.Format C: ought to be getting tired of karma fortunes by now.Format C: ought to be getting tired of karma fortunes by now.Format C: ought to be getting tired of karma fortunes by now.Format C: ought to be getting tired of karma fortunes by now.
 
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...
Format C: is offline   Reply With Quote
Advert
Reply


Forum Jump

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


All times are GMT -4. The time now is 03:32 AM.


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