[Schmitzm-commits] r2305 - in trunk/schmitzm-regex/src: main/java/de/schmitzm/regex test/java/de/schmitzm/regex

scm-commit at wald.intevation.org scm-commit at wald.intevation.org
Sun Apr 28 02:16:16 CEST 2013


Author: alfonx
Date: 2013-04-28 02:16:16 +0200 (Sun, 28 Apr 2013)
New Revision: 2305

Modified:
   trunk/schmitzm-regex/src/main/java/de/schmitzm/regex/RegexUtil.java
   trunk/schmitzm-regex/src/test/java/de/schmitzm/regex/RegexUtilTest.java
Log:


Modified: trunk/schmitzm-regex/src/main/java/de/schmitzm/regex/RegexUtil.java
===================================================================
--- trunk/schmitzm-regex/src/main/java/de/schmitzm/regex/RegexUtil.java	2013-04-28 00:01:00 UTC (rev 2304)
+++ trunk/schmitzm-regex/src/main/java/de/schmitzm/regex/RegexUtil.java	2013-04-28 00:16:16 UTC (rev 2305)
@@ -28,10 +28,13 @@
 			withoutTags = matcher.replaceAll(" ");
 
 		// Das macht Strassenangaben kaputt, die zwei hausnummern haben "Weg 3+4"
-		// matcher = rC.getMatcher("\\b\\+\\b", withoutTags);
-		// if (matcher.find())
-		// withoutTags = matcher.replaceAll(" ");
 
+		matcher = rC.getMatcher("\\b\\+\\b", withoutTags);
+		if (matcher.find() && matcher.find()) {
+			// Wennm mind. 2 Treffer
+			withoutTags = matcher.replaceAll(" ");
+		}
+
 		matcher = rC.getMatcher("\\s{1,}", withoutTags);
 		if (matcher.find())
 			withoutTags = matcher.replaceAll(" ");

Modified: trunk/schmitzm-regex/src/test/java/de/schmitzm/regex/RegexUtilTest.java
===================================================================
--- trunk/schmitzm-regex/src/test/java/de/schmitzm/regex/RegexUtilTest.java	2013-04-28 00:01:00 UTC (rev 2304)
+++ trunk/schmitzm-regex/src/test/java/de/schmitzm/regex/RegexUtilTest.java	2013-04-28 00:16:16 UTC (rev 2305)
@@ -13,7 +13,7 @@
 		assertEquals("hallo welt", RegexUtil.removeTags("<h1>hallo<td/>\n<td>welt</h1>"));
 		assertEquals("hallo welt", RegexUtil.removeTags("<h1>hallo<td/>  <td>welt</h1>"));
 		assertEquals("hallo welt", RegexUtil.removeTags("<h1>hallo<td/> \n <td image='asdasdasa'>welt</h1>"));
-		assertEquals("hallo *asd welt",
+		assertEquals("hallo asd welt",
 				RegexUtil.removeTags("<h1>hallo<td/><li>asd</li><td image='asdasdasa'>welt</h1>"));
 		assertEquals("hallo welt", RegexUtil.removeTags("<h1 time='as'>hallo<td/> \n <td image='asdasdasa'>welt</h1>"));
 



More information about the Schmitzm-commits mailing list