Index: src/org/openstreetmap/josm/tools/SearchCompilerQueryWizard.java
===================================================================
--- src/org/openstreetmap/josm/tools/SearchCompilerQueryWizard.java	(revision 17293)
+++ src/org/openstreetmap/josm/tools/SearchCompilerQueryWizard.java	(working copy)
@@ -15,6 +15,7 @@
 
 import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
 import org.openstreetmap.josm.data.osm.search.SearchCompiler;
+import org.openstreetmap.josm.data.osm.search.SearchCompiler.ExactKeyValue.Mode;
 import org.openstreetmap.josm.data.osm.search.SearchCompiler.Match;
 import org.openstreetmap.josm.data.osm.search.SearchParseError;
 
@@ -73,7 +74,7 @@
                     throw new IllegalStateException(mode);
                 }
             }
-            
+
             final Match match = SearchCompiler.compile(search);
             return constructQuery(match, "[bbox:{{bbox}}];", "");
         } catch (SearchParseError | UnsupportedOperationException e) {
@@ -129,7 +130,7 @@
             // [~"key"~"value", i] -- filter objects tagged with a key and a case-insensitive value matching regular expressions
             final String key = ((SearchCompiler.ExactKeyValue) match).getKey();
             final String value = ((SearchCompiler.ExactKeyValue) match).getValue();
-            final SearchCompiler.ExactKeyValue.Mode mode = ((SearchCompiler.ExactKeyValue) match).getMode();
+            final Mode mode = ((SearchCompiler.ExactKeyValue) match).getMode();
             switch (mode) {
                 case ANY_VALUE:
                     return "[" + (negated ? "!" : "") + quote(key) + "]";
@@ -136,10 +137,13 @@
                 case EXACT:
                     return "[" + quote(key) + (negated ? "!=" : "=") + quote(value) + "]";
                 case EXACT_REGEXP:
+                case ANY_KEY: // *=value
                     final Matcher matcher = Pattern.compile("/(?<regex>.*)/(?<flags>i)?").matcher(value);
                     final String valueQuery = matcher.matches()
                             ? quote(matcher.group("regex")) + Optional.ofNullable(matcher.group("flags")).map(f -> "," + f).orElse("")
                             : quote(value);
+                    if (mode == Mode.ANY_KEY)
+                        return "[~\"^.*$\"" + (negated ? "!~" : "~") + valueQuery + "]";
                     return "[" + quote(key) + (negated ? "!~" : "~") + valueQuery + "]";
                 case MISSING_KEY:
                     // special case for empty values, see https://github.com/drolbr/Overpass-API/issues/53
