private String doSimplify(String input, int depth) {
		int pos = 0;
		TemplateString ts = findTemplateString(input, pos);
		if (ts == null) {
			return input;		// Fast fail if no template characters present
		}
		StringBuilder builder = new StringBuilder();
		do {
			builder.append(input.substring(pos, ts.start));
			String template = ts.getTemplate();
			if (depth == 0) {
				builder.append("<");
				if (template.length() <= minTemplateLength) {
					builder.append(template);
				}
				builder.append(">");
			}
			else {
				builder.append("<");
				String simplifiedTemplate = doSimplify(template, depth - 1);
				if (simplifiedTemplate.length() > maxTemplateLength) {
					simplifiedTemplate = middleTruncate(template);
				}
				builder.append(simplifiedTemplate);
				builder.append(">");
			}
			pos = ts.end + 1;
			ts = findTemplateString(input, pos);
		}
		while (ts != null);
		builder.append(input.substring(pos));
		return builder.toString();
	}
Notification that options have changed
@param options the options object that has changed values
@param optionName the name of the options that changed
@param oldValue the old value for the option that changed
@param newValue the new value for the option that changed
@return true if the option that changed was a template simplification option
Ghidra/Features/Base/src/main/java/ghidra/app/util/template/TemplateSimplifier.java