Index: trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java	(revision 8130)
+++ trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java	(revision 8131)
@@ -496,4 +496,6 @@
             if (s.mode == SearchMode.replace) {
                 sel.clear();
+            } else if (s.mode == SearchMode.in_selection) {
+                foundMatches = sel.size();
             }
 
@@ -504,4 +506,5 @@
                 all = Main.main.getCurrentDataSet().allNonDeletedCompletePrimitives();
             }
+
             for (OsmPrimitive osm : all) {
                 if (s.mode == SearchMode.replace) {
@@ -516,7 +519,7 @@
                     sel.remove(osm);
                     ++foundMatches;
-                } else if (s.mode == SearchMode.in_selection &&  p.evaluate(osm) && !matcher.match(osm)) {
+                } else if (s.mode == SearchMode.in_selection && p.evaluate(osm) && !matcher.match(osm)) {
                     sel.remove(osm);
-                    ++foundMatches;
+                    --foundMatches;
                 }
             }
