Searching within the library
Last updated
Last updated
The search bar is located in the icon bar.
To make the cursor jump to the search field, you can:
Click in the search field.
Press Ctrl + F.
To find the search history, you can right click in the search field. Only ten recent searches will be displayed in the sub-menu. You can find clear history button under your search history.
In a normal search, the program searches your library for all occurrences of the words in your search string, once you entered it. Only entries containing all words will be considered matches. To search for sequences of words, enclose the sequences in double-quotes. For instance, the query progress "marine aquaculture" will match entries containing both the word "progress" and the phrase "marine aquaculture".
All entries that do not match are hidden, leaving for display the matching entries only.
To stop displaying the search results, just clear the search field, press Esc or click on the "Clear" (X
) button.
To search for entries whose author contains miller, enter: author = miller
. The =
sign is actually a shorthand for contains
. Searching for an exact match is possible using matches
or ==
.
If a field is not given, all fields are searched and one can mix the selection: video and year == 1932
will search for entries with any field containing video
and the field year
being exactly 1932
.
JabRef defines the following pseudo fields:
Pseudo field
Purpose
Example
anyfield
/ any
Search in any field
anyfield contains fruit
: search for entries having one of its fields containing the word fruit. This is identical to just writing apple
. It may be more useful as anyfield matches apple
, where one field must be exactly apple
for a match.
anykeyword
Search among the keywords
anykeyword matches apple
: search for entries which have the word apple among its keywords. However, as this also matches pineapple
, it may be more useful in searches of the type anykeyword matches apple
, which will not match apples
or pineapple
key
Search for citation keys
citationkey == miller2005
: search for an entry whose citation key is miller2005
entrytype
Search for entries of a certain type
entrytype = thesis
: search entries whose type (as displayed in the entrytype
column) contains the word thesis (which would be phdthesis and mastersthesis)
If the search term contains spaces, enclose it in quotes. Do not use spaces in the field specification! E.g., to search for entries with the title "image processing", type: title = "image processing"
and
, or
and not
To search for entries with the title or the keyword "image processing", type: title|keywords = "image processing"
. To search for entries without the title or the keyword "image processing", type: title|keywords != "image processing"
It is also possible to chain search expressions. In general, you can use and
, or
, not
, and parentheses as intuitively expected:
(author = miller or title|keywords = "image processing") and not author = brown and != author = blue
XY
X followed by Y
X|Y
Either X or Y
(X)
X, as a capturing group
!=
tests if the search term is not contained in the field (equivalent to not ... contains ...
)
At the right of the search text field, two buttons allow for selecting some settings:
Regular expressions
Whether the search query uses regular expressions.
Case sensitivity
Whether the search query is case-sensitive.
This applies to all "unfielded" search terms. Meaning: All search terms not specifying a field (e.g., title
).
This has changed with JabRef v6
JabRef offers operators for the fielded search. The general idea is to have =
for contains search and ==
for exact matches. Then, the !
can be used to force case-sensitive matching (when used at the end) and as negation, when used in front. Finally, the ~
sign is used to enable regular-expression-based search.
This leads to following operator combinations:
=
Case insensitive contains
=!
Case sensitive contains
==
Exact match, case insensitive
==!
Exact match, case sensitive
=~
Regex check, case insensitive
=~!
Regex check, case sensitive
!=
Negated case insensitive contains
!=!
Negated case sensitive contains
!==
Negated exact match, case insensitive
!==!
Negated exact match, case sensitive
!=~
Negated regex check, case insensitive
!=~!
Negated regex check, case sensitive
Remember, the regex option has no effect on "field = value" expressions. To use regex with field names, the expression must have the form "field =~ value", which will apply the regular expression regardless of the ".*" regex option. To put it another way, using field = myterm
explicitly disables regex while field =~ myterm
explicitly enables it, on this term only without affecting the rest of the search. Note that the "abc" case-sensitive option follows the same principle.
The idea makes sense, because it allows regex and non-regex terms to coexist in the same search.
However, in practice this is totally unintuitive and not worth the trade-off. My suggestion for the maintainers is to keep "field =~ value" explicit (always apply regex syntax for this term) and make "field = value" apply standard or regex syntax, depending on the regex button/checkmark. In other words, =
and =~
should be treated as equivalent when the regex option is enabled.
Personally, I keep regex enabled all the time, so adding escape characters as needed has become second nature.
This is how the search currently works in the development version.
title =~ pa*ediatric AND 1.0
Off
Matches "paediatric", "pediatric"
Matches "1.0"
title =~ pa*ediatric AND 1.0
On
Matches "paediatric", "pediatric"
Matches "1.0", "1+0" "1/0", "1q0", ...
title = pa*ediatric AND 1.0
Off
No match. Regex is disabled
"1.0"
title = pa*ediatric AND 1.0
On
No match. Regex is disabled for this term
Matches "1.0", "1+0" "1/0", "1q0", ...
In order to only search for content within specific fields and/or to include logical operators in the search expression, a special syntax is available in which these can be specified. Both the field specification and the search term support regular expressions.
Regular expressions (RegEx for short) define a language for representing patterns matching text, for example when searching. There are different types of RegEx languages. JabRef uses regular expressions as defined in Java. For extensive advanced information about Java's RegEx patterns, please have a look at the Java documentation and at the Java tutorial.
By default, regular expressions do not account for upper/lower casing. Hence, while the examples below are all in lower case, they match also upper- and mixed case strings.
If casing is important to your search, activate the case-sensitive button.
.
means: any character
+
means: one or more times
author != .+
returns entries with empty or no author field.
^
means: the beginning of a line
[a-zA-Z]
means: a through z or A through Z, inclusive (range)
$
means: the end of a line
X{n}
means: X, exactly n times
owner != ^[a-zA-Z]{3}$
returns empty and non-three-letter owners
\b
means: word boundary
\B
means: not a word boundary
keywords = \buv\b
matches uv but not lluvia (it does match uv-b however)
author = \bblack\b
matches black but neither blackwell nor blacker
author == black
does not match john black, but author = \bblack\b
does.
author = \bblack\B
matches blackwell and blacker, but not black.
?
means: none or one copy of the preceding character.
{n,m}
means: at least n, but not more than m copies of the preceding character.
[ ]
defines a character class
title =neighbou?r
matches neighbour and neighbor, and also neighbours and neighbors, and neighbouring and neighboring, etc.
title = neighbou?rs?\b
matches neighbour and neighbor, and also neighbours and neighbors, but neither neighbouring nor neighboring.
author = s[aá]nchez
matches sanchez and sánchez.
abstract = model{1,2}ing
matches modeling and modelling.
abstract = modell?ing
also matches modeling and modelling.
year == 200[5-9]|201[0-1]
specifies the range of years 2005-2011 (200[5-9]
specifies years 2005-2009;|
means "or"; 201[0-1]
specifies years 2010-2011).
author = (John|Doe)
matches entries written by either John or Doe.
author = (John|Doe).+(John|Doe)
matches entries written by both John or Doe.
()[]{}\^-=$!|?*+.
)If a special character (i.e. (
)
[
]
{
}
\
^
-
=
$
!
|
?
*
+
.
) is included in your search string, it has to be escaped with a backslash, such as \}
for }
.
It means that to search for a string including a backslash, two consecutive backslashes (\\
) have to be used: abstract = xori{\\c{c}}o
matches xoriço.
"
)The character "
has a special meaning: it is used to group words into phrases for exact matches. So, if you search for a string that includes a double quotation, the double quotation character has to be replaced with the hexadecimal character 22 in ASCII table \x22
.
Neither a simple backslash \"
, nor a double backslash \\"
will work as an escape for "
. Neither author = {\"o}quist
with regular expression disabled, nor author = \{\\\"O\}quist
with regular expression enabled, will find anything, even if the name {\"o}quist
exists in the library.
Hence, to search for {\"o}quist
as an author, you must input author = \{\\\x22o\}quist
, with regular expressions enabled (Note: the \
, {
, _
and the }
are escaped with a backslash; see above).
X?
X, once or not at all
X*
X, zero or more times
X+
X, one or more times
X{n}
X, exactly n times
X{n,}
X, at least n times
X{n,m}
X, at least n but not more than m times
X??
X, once or not at all
X*?
X, zero or more times
X+?
X, one or more times
X{n}?
X, exactly n times
X{n,}?
X, at least n times
X{n,m}?
X, at least n but not more than m times
X?+
X, once or not at all
X*+
X, zero or more times
X++
X, one or more times
X{n}+
X, exactly n times
X{n,}+
X, at least n times
X{n,m}+
X, at least n but not more than m times