Index: src/org/openstreetmap/josm/actions/search/SearchCompiler.java
===================================================================
--- src/org/openstreetmap/josm/actions/search/SearchCompiler.java	(revision 1603)
+++ src/org/openstreetmap/josm/actions/search/SearchCompiler.java	(working copy)
@@ -105,31 +105,20 @@
 
                 Pattern searchKey   = null;
                 Pattern searchValue = null;
+                int searchFlags = regexFlags();
 
-                if (caseSensitive) {
-                    try {
-                        searchKey = Pattern.compile(key);
-                    } catch (PatternSyntaxException e) {
-                        throw new ParseError(tr(rxErrorMsg, e.getPattern(), e.getIndex(), e.getMessage()));
-                    }
-                    try {
-                        searchValue = Pattern.compile(value);
-                    } catch (PatternSyntaxException e) {
-                        throw new ParseError(tr(rxErrorMsg, e.getPattern(), e.getIndex(), e.getMessage()));
-                    }
-                } else {
-                    try {
-                        searchKey = Pattern.compile(key, Pattern.CASE_INSENSITIVE);
-                    } catch (PatternSyntaxException e) {
-                        throw new ParseError(tr(rxErrorMsg, e.getPattern(), e.getIndex(), e.getMessage()));
-                    }
-                    try {
-                        searchValue = Pattern.compile(value, Pattern.CASE_INSENSITIVE);
-                    } catch (PatternSyntaxException e) {
-                        throw new ParseError(tr(rxErrorMsg, e.getPattern(), e.getIndex(), e.getMessage()));
-                    }
+                try {
+                    searchKey = Pattern.compile(key, searchFlags);
+                } catch (PatternSyntaxException e) {
+                    throw new ParseError(tr(rxErrorMsg, e.getPattern(), e.getIndex(), e.getMessage()));
                 }
 
+                try {
+                    searchValue = Pattern.compile(value, searchFlags);
+                } catch (PatternSyntaxException e) {
+                    throw new ParseError(tr(rxErrorMsg, e.getPattern(), e.getIndex(), e.getMessage()));
+                }
+
                 for (Entry<String, String> e : osm.keys.entrySet()) {
                     String k = e.getKey();
                     String v = e.getValue();
@@ -182,18 +171,12 @@
 
             if (regexSearch) {
                 search = s;
-                if (caseSensitive) {
-                    try {
-                        searchRegex = Pattern.compile(search);
-                    } catch (PatternSyntaxException e) {
-                        throw new ParseError(tr(rxErrorMsg, e.getPattern(), e.getIndex(), e.getMessage()));
-                    }
-                } else {
-                    try {
-                        searchRegex = Pattern.compile(search, Pattern.CASE_INSENSITIVE);
-                    } catch (PatternSyntaxException e) {
-                        throw new ParseError(tr(rxErrorMsg, e.getPattern(), e.getIndex(), e.getMessage()));
-                    }
+                int searchFlags = regexFlags();
+
+                try {
+                    searchRegex = Pattern.compile(search, searchFlags);
+                } catch (PatternSyntaxException e) {
+                    throw new ParseError(tr(rxErrorMsg, e.getPattern(), e.getIndex(), e.getMessage()));
                 }
             } else {
                 search = caseSensitive ? s : s.toLowerCase();
@@ -490,4 +473,27 @@
             return new KeyValue(key, value);
         }
     }
+
+    private int regexFlags() {
+        int searchFlags = 0;
+
+        // Enables canonical Unicode equivalence so that e.g. the two
+        // forms of "égal", "\u00e9gal" and "e\u0301gal" will match.
+        //
+        // I don't know how common this is in the OSM data but it
+        // makes sense to match "é" to "é" no matter how the character
+        // happened to be constructed.
+        searchFlags |= Pattern.CANON_EQ;
+
+        // Make "." match any character including newline (/s in Perl)
+        searchFlags |= Pattern.DOTALL;
+
+        // CASE_INSENSITIVE by itself only matches US-ASCII case
+        // insensitively, but the OSM data is in Unicode. With
+        // UNICODE_CASE casefolding is made Unicode-aware.
+        if (!caseSensitive)
+            searchFlags |= (Pattern.CASE_INSENSITIVE | Pattern.UNICODE_CASE);
+        
+        return searchFlags;
+    }
 }
