String result = original;
RegEX i = getInstance();
Perl5Substitution sub = i.localP5Sub.get();
Perl5Matcher matcher = i.localP5Matcher.get();
sub.setSubstitution(substitution);
Pattern pattern;
try {
pattern = i.getPattern(regEx);
} catch (MalformedPatternException e) {
Logger.error(RegEX.class, "Unable to compile pattern for regex", e);
throw new DotRuntimeException("Unable to compile pattern for regex",e);