Skip to content
Closed
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv
### Changed

- We changed `ISSNCleanup` into `NormalizeIssn` a `ISSN` formatter. [#13748](https://github.com/JabRef/jabref/issues/13748)
- The space character in a search field content is now also accepted when escaped. [#13836](https://github.com/JabRef/jabref/pull/13836)
- We changed Citation Relations tab and gave tab panes more descriptive titles and tooltips. [#13619](https://github.com/JabRef/jabref/issues/13619)
- We changed the name from Open AI Provider to Open AI (or API compatible). [#13585](https://github.com/JabRef/jabref/issues/13585)
- We improved the citations relations caching by implementing an offline storage. [#11189](https://github.com/JabRef/jabref/issues/11189)
Expand Down
14 changes: 7 additions & 7 deletions jablib/src/main/antlr/org/jabref/search/Search.g4
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,22 @@ WS: [ \t\n\r]+ -> skip; // whitespace is ignored/skipped
LPAREN: '(';
RPAREN: ')';

EQUAL: '='; // case insensitive contains, semantically the same as CONTAINS
EQUAL: '='; // case insensitive contains, semantically the same as CONTAINS
CEQUAL: '=!'; // case sensitive contains

EEQUAL: '=='; // exact match case insensitive, semantically the same as MATCHES
EEQUAL: '=='; // exact match case insensitive, semantically the same as MATCHES
CEEQUAL: '==!'; // exact match case sensitive

REQUAL: '=~'; // regex check case insensitive
REQUAL: '=~'; // regex check case insensitive
CREEQUAL: '=~!'; // regex check case sensitive

NEQUAL: '!='; // negated case insensitive contains
NEQUAL: '!='; // negated case insensitive contains
NCEQUAL: '!=!'; // negated case sensitive contains

NEEQUAL: '!=='; // negated case insensitive exact match
NEEQUAL: '!=='; // negated case insensitive exact match
NCEEQUAL: '!==!'; // negated case sensitive exact match

NREQUAL: '!=~'; // negated regex check case insensitive
NREQUAL: '!=~'; // negated regex check case insensitive
NCREEQUAL: '!=~!'; // negated regex check case sensitive

AND: 'AND';
Expand All @@ -41,7 +41,7 @@ NOT: 'NOT';

FIELD: [A-Z]([A-Z] | '-' | '_')*; // field name should allow for - or _
STRING_LITERAL: '"' ('\\"' | ~["])* '"'; // " should be escaped with a backslash
TERM: ('\\' [=!~()] | ~[ \t\n\r=!~()])+; // =!~() should be escaped with a backslash
TERM: ('\\' [ :=!~()] | ~[ :=!~()\t\r\n])+; // space and :, =, !, ~, (, ) should be escaped with a backslash; \t\r\n cannot be escaped

start
: EOF
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public class SearchQueryTest {
@ParameterizedTest
@CsvSource({
"term",
"101.1007/JHEP02(2023)082", // invalid DOI but valid search term
"term1 term2",
"term1 term2 term3",
"term1 AND term2",
Expand All @@ -23,6 +24,8 @@ public class SearchQueryTest {
"NOT (term1 AND term2)",
"\"term\"",
"\"term1 term2\"",
"termpart1\\ termpart2",
"termpart1\\:termpart2",
"Breitenb{\\\"{u}}cher",
"K{\\'{a}}lm{\\'{a}}n K{\\'{e}}pes",
"field = value",
Expand All @@ -46,6 +49,7 @@ public class SearchQueryTest {
"t\\~erm",
"t\\(1\\)erm",
"t\\\"erm",
"t\\ erm",
})
public void validSearchQuery(String searchExpression) {
assertTrue(new SearchQuery(searchExpression).isValid());
Expand All @@ -57,6 +61,8 @@ public void validSearchQuery(String searchExpression) {
"t~erm",
"t(erm",
"term AND",
"field:value",
"field : value",
"field CONTAINS NOT value",
})
public void invalidSearchQuery(String searchExpression) {
Expand Down
Loading