Skip to content
Browse files
Java Regex replaceAll() would replace too much
The Java Regex implementation sees an empty group at the end of
a string, when matching against .*. So let us rephrase our wish
to at least one character.
  • Loading branch information
FSchumacher committed Mar 5, 2022
1 parent ee0ae76 commit bfd9b384c48fc203b6d4f2e35bee01c439e0c08f
Showing 1 changed file with 1 addition and 1 deletion.
@@ -98,7 +98,7 @@ public void testReverseReplacementXml() throws Exception {
public void testOverlappingMatches() throws Exception {
TestPlan plan = new TestPlan();
plan.addParameter("longMatch", "servername");
plan.addParameter("shortMatch", ".*");
plan.addParameter("shortMatch", ".+");
ValueReplacer replacer = new ValueReplacer(plan);
TestElement element = new TestPlan();
element.setProperty(new StringProperty("domain", "servername.domain"));

0 comments on commit bfd9b38

Please sign in to comment.