}
}
@Test
public void testGetNewName_Regex_All() {
MatchReplaceRule rule = new MatchReplaceRule();
rule.setMatchString("[ab]");
rule.setReplaceString("c");
rule.setMatchRegularExpressions(true);
rule.setReplacementLimit(ReplacementLimit.ALL);
File aaaFile = new File("ababab.txt");
try {
String newName = rule.getNewName(aaaFile);
assertTrue(newName.equals("cccccc.txt"));
} catch (IOException e) {
fail("Should not throw an exception");
e.printStackTrace();
}