Index: trunk/src/org/openstreetmap/josm/actions/search/SearchCompiler.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/search/SearchCompiler.java	(revision 1606)
+++ trunk/src/org/openstreetmap/josm/actions/search/SearchCompiler.java	(revision 1607)
@@ -93,5 +93,5 @@
         @Override public boolean match(OsmPrimitive osm) throws ParseError {
 
-            if (regexSearch) { 
+            if (regexSearch) {
                 if (osm.keys == null)
                     return false;
@@ -106,27 +106,11 @@
                 Pattern searchKey   = null;
                 Pattern searchValue = null;
-
-                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()));
-                    }
+                int searchFlags = regexFlags();
+
+                try {
+                    searchKey = Pattern.compile(key, searchFlags);
+                    searchValue = Pattern.compile(value, searchFlags);
+                } catch (PatternSyntaxException e) {
+                    throw new ParseError(tr(rxErrorMsg, e.getPattern(), e.getIndex(), e.getMessage()));
                 }
 
@@ -183,16 +167,10 @@
             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 {
@@ -275,9 +253,9 @@
         @Override public String toString() {return "nodes="+count;}
     }
-    
+
     private static class NodeCountRange extends Match {
         private int minCount;
         private int maxCount;
-        public NodeCountRange(int minCount, int maxCount) { 
+        public NodeCountRange(int minCount, int maxCount) {
             if(maxCount < minCount) {
                 this.minCount = maxCount;
@@ -323,5 +301,5 @@
         @Override public String toString() {return "untagged";}
     }
-        
+
     private static class Parent extends Match {
         private Match child;
@@ -334,5 +312,5 @@
             if (child == null)
                 child = new Always();
-                
+
             if (osm instanceof Way) {
                 for (Node n : ((Way)osm).nodes)
@@ -474,10 +452,10 @@
                 return new NodeCount(Integer.parseInt(value));
             } catch(Exception x) {}
-        
+
             try {
                 String[] range = value.split("-", 2);
                 return new NodeCountRange(Integer.parseInt(range[0]), Integer.parseInt(range[1]));
             } catch(Exception x) {}
-            
+
             return new NodeCount(0);
         } else if (key.equals("id")) {
@@ -491,3 +469,25 @@
         }
     }
+
+    private int regexFlags() {
+        int searchFlags = 0;
+
+        // Enables canonical Unicode equivalence so that e.g. the two
+        // forms of "\u00e9gal" and "e\u0301gal" will match.
+        //
+        // It makes sense to match 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;
+    }
 }
