![]() |
#1 |
Junior Member
![]() Posts: 2
Karma: 10
Join Date: Jun 2013
Device: PC
|
Search expressions
Hello,
Sorry if this has been posted before, I couldn't find anything on the forum, and wasn't able to find what I need from stackoverflow or the python documentation. I want to create a Virtual library with tags "Fiction" but not "Young Adult". So I created a virtual library with "Fiction" as the requirement, and wanted to add in additional restrictions. But, I can't figure out how to search for tags: !=Young Adult properly. I've pretty much tried all possible placements of the quotes, as well as using <> instead of !=. I'm not really sure what else I can do. ![]() Thank you in advance for your help! |
![]() |
![]() |
![]() |
#2 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,207
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,553
Karma: 950151
Join Date: Nov 2008
Device: Sony PRS-950, iphone/ipad (Marvin/iBooks/QuickReader)
|
Although it is used in the examples I do not think that the documentation explicitly mentions that the word 'and', 'or' and 'not' are operators that can be used with search terms and that terms can be grouped using brackets.
In the OP request it appears the use of 'not' was missed in the things tried. |
![]() |
![]() |
![]() |
#4 | |
US Navy, Retired
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,890
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Kindle PaperWhite SE 11th Gen
|
Quote:
Code:
not tags:"=Young Adult" and tags:"=Fiction" |
|
![]() |
![]() |
![]() |
#5 |
Junior Member
![]() Posts: 7
Karma: 10
Join Date: May 2013
Device: K3 (Keyboard)
|
There is something strange in regex search. I can't imagine how it works:
![]() Pattern is in the beginning, in the middle or even as a part of word. And there is no any special character in the pattern! Is this the way it should work? |
![]() |
![]() |
Advert | |
|
![]() |
#6 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,341
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
If you want to be sure that the pattern is matching the beginning, the end, or all of the item then you must include anchor specifications in the regexp. If you put the anchor ^ at the beginning of the regexp then the pattern must match at the beginning of the item. Of you put the anchor $ at the end of the regexp then the pattern must match the end of the item. Include them both to indicate you want both the beginning and the end, that is the entire item. |
|
![]() |
![]() |
![]() |
#7 |
Junior Member
![]() Posts: 2
Karma: 10
Join Date: Jun 2013
Device: PC
|
Thank you very much for all the help. It worked out great =)
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Regular Expressions help | deamonfruba | Library Management | 2 | 06-02-2012 02:09 AM |
Regular Expressions | littleezza | Conversion | 1 | 07-15-2011 11:52 AM |
Another help with regular expressions | encapuchado | Library Management | 6 | 06-21-2011 03:14 PM |
Need help with expressions | MMAC | Library Management | 2 | 04-25-2011 05:49 AM |
Help with Regular Expressions | ghostyjack | Workshop | 2 | 01-08-2010 11:04 AM |