Index: trunk/test/unit/org/openstreetmap/josm/data/osm/search/SearchCompilerTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/osm/search/SearchCompilerTest.java	(revision 16257)
+++ trunk/test/unit/org/openstreetmap/josm/data/osm/search/SearchCompilerTest.java	(revision 16260)
@@ -142,4 +142,19 @@
 
     /**
+     * Search by regular expression: key~value.
+     * @throws SearchParseError if an error has been encountered while compiling
+     */
+    @Test
+    public void testRegexp() throws SearchParseError {
+        final SearchCompiler.Match c = SearchCompiler.compile("foo~[Bb]a[rz]");
+        assertFalse(c.match(newPrimitive("foobar", "true")));
+        assertFalse(c.match(newPrimitive("foo", "foo")));
+        assertTrue(c.match(newPrimitive("foo", "bar")));
+        assertTrue(c.match(newPrimitive("foo", "baz")));
+        assertTrue(c.match(newPrimitive("foo", "Baz")));
+        assertEquals("foo=[Bb]a[rz]", c.toString());
+    }
+
+    /**
      * Search by comparison.
      * @throws SearchParseError if an error has been encountered while compiling
