You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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".
24
24
25
25
All entries that do not match are hidden, leaving for display the matching entries only.
26
26
27
27
To stop displaying the search results, just clear the search field, press Esc or click on the "Clear" (`X`) button.
28
28
29
-
## Search using regular expressions <ahref="#advanced"id="advanced"></a>
29
+
## Search using regular expressions <ahref="#regular-expressions"id="regular-expressions"></a>
30
30
31
31
{% hint style="warning" %}
32
32
Make sure that the button "regular expressions" is activated
33
33
{% endhint %}
34
34
35
35
### General syntax
36
36
37
-
In order to search specific fields only and/or include logical operators in the search expression, a special syntax is available in which these can be specified. E.g. to search for entries whose an author contains **miller**, enter:
37
+
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](search.md#regular-expressions).
38
38
39
-
`author = miller`
39
+
#### Search within specific Fields
40
40
41
-
Both the field specification and the search term support [regular expressions](search.md#regular-expressions). If the search term contains spaces, enclose it in quotes. Do _not_ use spaces in the field specification! E.g. to search for entries about image processing, type:
41
+
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 `==`.
42
42
43
-
`title|keywords = "image processing"`
43
+
#### Search for terms containing spaces
44
44
45
-
You can use `and`, `or`, `not`, and parentheses as intuitively expected:
45
+
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"`
46
46
47
-
`(author = miller or title|keywords = "image processing") and not author = brown`
47
+
#### Search using parentheses, `and`, `or`and `not`
48
48
49
-
The `=` sign is actually a shorthand for `contains`. Searching for an exact match is possible using `matches` or `==`. Using `!=` tests if the search term is _not_ contained in the field (equivalent to `not ... contains ...`). The selection of field types to search (required, optional, all) is always overruled by the field specification in the search expression. If a field is not given, all fields are searched. For example, `video and year == 1932` will search for entries with any field containing `video` and the field `year` being exactly `1932`.
49
+
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:
50
+
51
+
`(author = miller or title|keywords = "image processing") and not author = brown and != author = blue`
52
+
53
+
Logical Operator / Symbol | Explanation
54
+
|:---|:---|
55
+
XY | X followed by Y
56
+
X\|Y | Either X or Y
57
+
(X) | X, as a capturing group
58
+
| != | tests if the search term is _not_ contained in the field (equivalent to `not ... contains ...`)|
59
+
60
+
#### Regular Expression search and Field Types
61
+
62
+
The selection of field types to search (required, optional, all) is always overruled by the field specification in the search expression. If a field is not given, all fields are searched. For example, `video and year == 1932` will search for entries with any field containing `video` and the field `year` being exactly `1932`.
50
63
51
64
### Pseudo fields
52
65
@@ -60,9 +73,9 @@ JabRef defines the following pseudo fields:
60
73
|`key`| Search for citation keys |`citationkey == miller2005`: search for an entry whose citation key is **miller2005**|
61
74
|`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**) |
62
75
63
-
### Advanced use of regular expressions
76
+
### Advanced use of regular expressions <ahref="#regular-expressions-advanced"id="regular-expressions-advanced"></a>
64
77
65
-
Regular expressions (regex for short) define a language for specifying the text to be matched, for example when searching. JabRef uses regular expressions as defined in Java. For extensive information, please, look at the [Java documentation](https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/regex/Pattern.html) and at the [Java tutorial](https://docs.oracle.com/javase/tutorial/essential/regex/).
78
+
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](https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/regex/Pattern.html) and at the [Java tutorial](https://docs.oracle.com/javase/tutorial/essential/regex/).
66
79
67
80
#### Regular expressions and casing
68
81
@@ -72,15 +85,22 @@ If casing is important to your search, activate the case-sensitive button.
72
85
73
86
#### Searching for entries with an empty or missing field
74
87
75
-
*`.` means any character
76
-
*`+` means one or more times
88
+
*`.` means: any character
89
+
*`+` means: one or more times
77
90
78
91
`author != .+` returns entries with empty or no author field.
79
92
93
+
*`^` means: the beginning of a line
94
+
*`[a-zA-Z]` means: a through z or A through Z, inclusive (range)
95
+
*`$` means: the end of a line
96
+
*`X{n}` means: X, exactly n times
97
+
98
+
`owner != ^[a-zA-Z]{3}$` returns empty and non-three-letter owners
99
+
80
100
#### Searching for a given word
81
101
82
-
*`\b` means word boundary
83
-
*`\B` means not a word boundary
102
+
*`\b` means: word boundary
103
+
*`\B` means: not a word boundary
84
104
85
105
`keywords = \buv\b` matches _uv_ but not _lluvia_ (it does match _uv-b_ however)
86
106
@@ -92,8 +112,8 @@ If casing is important to your search, activate the case-sensitive button.
92
112
93
113
#### Searching with optional spelling
94
114
95
-
*`?` means none or one copy of the preceding character.
96
-
*`{n,m}` means at least _n_, but not more than _m_ copies of the preceding character.
115
+
*`?` means: none or one copy of the preceding character.
116
+
*`{n,m}` means: at least _n_, but not more than _m_ copies of the preceding character.
97
117
*`[ ]` defines a character class
98
118
99
119
`title =neighbou?r` matches _neighbour_ and _neighbor_, and also _neighbours_ and _neighbors_, and _neighbouring_ and _neighboring_, etc.
@@ -122,6 +142,39 @@ It means that to search for a string including a backslash, two consecutive back
122
142
123
143
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`.
124
144
125
-
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).
126
-
127
-
Indeed, `\"` does not work as an escape for `"`. Hence, 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.
145
+
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.
146
+
147
+
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).
0 commit comments