} else if (line.trim().equals("}")) {
blockDepth--;
}
if (blockDepth == 0){
ScriptBlock block = new ScriptBlock(scriptblock, repl);
rp = new ReplacementScript(regex, block, replopts, caseSensitive, sameOutputCase);
setScriptForAlias(repl, block);
break;
} else {
scriptblock.add(line);
}