[Schmitzm-commits] r2268 - in trunk: schmitzm-adresses/src/main/java/de/schmitzm/adresses schmitzm-regex/src/main/java/de/schmitzm/regex

scm-commit at wald.intevation.org scm-commit at wald.intevation.org
Sat Mar 2 01:22:14 CET 2013


Author: alfonx
Date: 2013-03-02 01:22:14 +0100 (Sat, 02 Mar 2013)
New Revision: 2268

Modified:
   trunk/schmitzm-adresses/src/main/java/de/schmitzm/adresses/AddrStringUtil.java
   trunk/schmitzm-regex/src/main/java/de/schmitzm/regex/RegexCache.java
Log:


Modified: trunk/schmitzm-adresses/src/main/java/de/schmitzm/adresses/AddrStringUtil.java
===================================================================
--- trunk/schmitzm-adresses/src/main/java/de/schmitzm/adresses/AddrStringUtil.java	2013-03-01 23:46:51 UTC (rev 2267)
+++ trunk/schmitzm-adresses/src/main/java/de/schmitzm/adresses/AddrStringUtil.java	2013-03-02 00:22:14 UTC (rev 2268)
@@ -736,6 +736,7 @@
 		strasse = RegexCache.getInstance().replaceAll(strasse, "tra(ss|ß)e\\b", "tr.");
 		strasse = RegexCache.getInstance().replaceAll(strasse, "str[^\\.]\\b", "str.");
 		strasse = RegexCache.getInstance().replaceAll(strasse, "([^\\d^\\s])(\\d)", "$1 $2");
+		strasse = RegexCache.getInstance().replaceAll(strasse, "(?i-)^\\s*[^a-züäö0-9]*\\s*", "");
 		strasse = RegexCache.getInstance().replaceAll(strasse, "str$", "str.");
 
 		strasse = RegexCache.getInstance().replaceAll(strasse, "^Str\\.$", "");

Modified: trunk/schmitzm-regex/src/main/java/de/schmitzm/regex/RegexCache.java
===================================================================
--- trunk/schmitzm-regex/src/main/java/de/schmitzm/regex/RegexCache.java	2013-03-01 23:46:51 UTC (rev 2267)
+++ trunk/schmitzm-regex/src/main/java/de/schmitzm/regex/RegexCache.java	2013-03-02 00:22:14 UTC (rev 2268)
@@ -81,14 +81,12 @@
 	public final Pattern getPattern(final String regex) {
 		if (regex == null)
 			return null;
-		// synchronized (regex) {
 		Pattern p = patternCache.get(regex);
 		if (p == null) {
 			p = Pattern.compile(regex);
 			patternCache.put(regex, p);
 		}
 		return p;
-		// }
 	}
 
 	/**



More information about the Schmitzm-commits mailing list