Index: applications/editors/josm/plugins/terracer/build.xml
===================================================================
--- applications/editors/josm/plugins/terracer/build.xml	(revision 24888)
+++ applications/editors/josm/plugins/terracer/build.xml	(revision 24889)
@@ -32,5 +32,5 @@
 
 
-    <property name="commit.message" value="applied #j5729 (patch by robome) - make terracing with existing address nodes easier" />
+    <property name="commit.message" value="applied #j5760 (patch by robome) - Order of housenumbers not correct" />
     <property name="plugin.main.version" value="3711" />
 
Index: applications/editors/josm/plugins/terracer/src/terracer/TerracerAction.java
===================================================================
--- applications/editors/josm/plugins/terracer/src/terracer/TerracerAction.java	(revision 24888)
+++ applications/editors/josm/plugins/terracer/src/terracer/TerracerAction.java	(revision 24889)
@@ -234,5 +234,5 @@
      */
     class HousenumberNodeComparator implements Comparator<Node> {
-        private final Pattern pat = Pattern.compile("^([0-9]+)");
+        private final Pattern pat = Pattern.compile("^(\\d+)\\s*(.*)");
 
         /*
@@ -252,7 +252,15 @@
             if (mat.find()) {
                 Integer node1Int = Integer.valueOf(mat.group(1));
+                String node1Rest = mat.group(2);
                 mat = pat.matcher(node2String);
                 if (mat.find()) {
                     Integer node2Int = Integer.valueOf(mat.group(1));
+                    // If the numbers are the same, the rest has to make the decision,
+                    // e.g. when comparing 23, 23a and 23b.
+                    if (node1Int.equals(node2Int))
+                    {
+                      String node2Rest = mat.group(2);
+                      return node1Rest.compareTo(node2Rest);
+                    }
 
                     return node1Int.compareTo(node2Int);
