Index: trunk/test/unit/org/openstreetmap/josm/data/osm/search/SearchCompilerTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/osm/search/SearchCompilerTest.java	(revision 18191)
+++ trunk/test/unit/org/openstreetmap/josm/data/osm/search/SearchCompilerTest.java	(revision 18195)
@@ -19,4 +19,9 @@
 import java.util.Set;
 
+import org.junit.Assert;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.Timeout;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.ValueSource;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.data.coor.LatLon;
@@ -45,7 +50,4 @@
 import nl.jqno.equalsverifier.EqualsVerifier;
 import nl.jqno.equalsverifier.Warning;
-import org.junit.Assert;
-import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.Timeout;
 
 /**
@@ -145,5 +147,5 @@
      */
     @Test
-    void testRegexpCaseSensitive() throws Exception {
+    void testRegexpCaseSensitive() throws SearchParseError {
         SearchSetting searchSetting = new SearchSetting();
         searchSetting.regexSearch = true;
@@ -829,3 +831,13 @@
         sc.match(sc.n2, false);
     }
+
+    /**
+     * Non-regression test for JOSM #21300
+     * @param searchString search string to test
+     */
+    @ParameterizedTest
+    @ValueSource(strings = {"maxweight<" /* #21300 */, "maxweight>"})
+    void testNonRegression21300(final String searchString) {
+        assertThrows(SearchParseError.class, () -> SearchCompiler.compile(searchString));
+    }
 }
