}
private Any doSubstitute(Context context, String string, Any replacement, int substFlags)
{
Substitution substitution;
if (replacement.isString()) {
String s = replacement.toString();
if (s.indexOf('$') != -1) {
substitution = new Perl5Substitution(s);
} else {