Pattern pattern = new Perl5Compiler().compile(targetString.substring("regex:".length(), msgPos));
Perl5Matcher matcher = new Perl5Matcher();
if (matcher.matches(address.toString(), pattern)) {
MatchResult match = matcher.getMatch();
Map parameters = new HashMap(match.groups());
for (int i = 1; i < match.groups(); i++) {
parameters.put(Integer.toString(i), match.group(i));
}
result = XMLResources.replaceParameters(targetString.substring(msgPos + 1), parameters);
}