Index: /trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java	(revision 8970)
+++ /trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java	(revision 8971)
@@ -49,4 +49,5 @@
 import org.openstreetmap.josm.gui.preferences.ToolbarPreferences.ActionParser;
 import org.openstreetmap.josm.gui.progress.ProgressMonitor;
+import org.openstreetmap.josm.gui.widgets.AbstractTextComponentValidator;
 import org.openstreetmap.josm.gui.widgets.HistoryComboBox;
 import org.openstreetmap.josm.tools.GBC;
@@ -228,6 +229,7 @@
         JLabel label = new JLabel(initialValues instanceof Filter ? tr("Filter string:") : tr("Search string:"));
         final HistoryComboBox hcbSearchString = new HistoryComboBox();
+        final String tooltip = tr("Enter the search expression");
         hcbSearchString.setText(initialValues.text);
-        hcbSearchString.setToolTipText(tr("Enter the search expression"));
+        hcbSearchString.setToolTipText(tooltip);
         // we have to reverse the history, because ComboBoxHistory will reverse it again in addElement()
         //
@@ -280,4 +282,32 @@
         right = new JPanel(new GridBagLayout());
         buildHints(right, hcbSearchString);
+
+        final JTextComponent editorComponent = (JTextComponent) hcbSearchString.getEditor().getEditorComponent();
+        editorComponent.getDocument().addDocumentListener(new AbstractTextComponentValidator(editorComponent) {
+
+            @Override
+            public void validate() {
+                if (!isValid()) {
+                    feedbackInvalid(tr("Invalid search expression"));
+                } else {
+                    feedbackValid(tooltip);
+                }
+            }
+
+            @Override
+            public boolean isValid() {
+                try {
+                    SearchSetting ss = new SearchSetting();
+                    ss.text = hcbSearchString.getText();
+                    ss.caseSensitive = caseSensitive.isSelected();
+                    ss.regexSearch = regexSearch.isSelected();
+                    ss.mapCSSSearch = mapCSSSearch.isSelected();
+                    SearchCompiler.compile(ss);
+                    return true;
+                } catch (ParseError e) {
+                    return false;
+                }
+            }
+        });
 
         final JPanel p = new JPanel(new GridBagLayout());
@@ -619,4 +649,8 @@
         }
 
+        /**
+         * Constructs a new {@code SearchSetting} from an existing one.
+         * @param original original search settings
+         */
         public SearchSetting(SearchSetting original) {
             text = original.text;
Index: /trunk/src/org/openstreetmap/josm/actions/search/SearchCompiler.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/search/SearchCompiler.java	(revision 8970)
+++ /trunk/src/org/openstreetmap/josm/actions/search/SearchCompiler.java	(revision 8971)
@@ -635,5 +635,7 @@
             Double v = null;
             try {
-                v = Double.valueOf(referenceValue);
+                if (referenceValue != null) {
+                    v = Double.valueOf(referenceValue);
+                }
             } catch (NumberFormatException ignore) {
                 if (Main.isTraceEnabled()) {
