@@ -0,0 +1,1440 @@
+package org.jabref.model.search.rules;%0A%0Aimport org.jabref.model.entry.BibEntry;%0Aimport org.jabref.model.entry.field.StandardField;%0Aimport org.jabref.model.entry.types.StandardEntryType;%0A%0Aimport org.junit.jupiter.api.Test;%0A%0Aimport static org.junit.jupiter.api.Assertions.assertFalse;%0Aimport static org.junit.jupiter.api.Assertions.assertTrue;%0A%0A/**%0A * Test case for GrammarBasedSearchRuleTest.%0A */%0Apublic class GrammarBasedSearchRuleTest %7B%0A%0A    @Test%0A    void applyRuleMatchesSingleTermWithRegex() %7B%0A        GrammarBasedSearchRule searchRule = new GrammarBasedSearchRule(true, true);%0A%0A        String query = %22M%5Ba-z%5D+e%22;%0A        assertTrue(searchRule.validateSearchStrings(query));%0A        assertTrue(searchRule.applyRule(query, makeBibtexEntry()));%0A    %7D%0A%0A    @Test%0A    void applyRuleDoesNotMatchSingleTermWithRegex() %7B%0A        GrammarBasedSearchRule searchRule = new GrammarBasedSearchRule(true, true);%0A%0A        String query = %22M%5B0-9%5D+e%22;%0A        assertTrue(searchRule.validateSearchStrings(query));%0A        assertFalse(searchRule.applyRule(query, makeBibtexEntry()));%0A    %7D%0A%0A    public BibEntry makeBibtexEntry() %7B%0A        return new BibEntry(StandardEntryType.InCollection)%0A                .withCitationKey(%22shields01%22)%0A                .withField(StandardField.TITLE, %22Marine finfish larviculture in Europe%22)%0A                .withField(StandardField.YEAR, %222001%22)%0A                .withField(StandardField.AUTHOR, %22Kevin Shields%22);%0A    %7D%0A%7D%0A

Add test for GrammarBasedSearchRule