public String extractTraces(String somethingContainingTraces) {
        Pattern pattern = Pattern.compile("(" + Pattern.quote(prefix()) + ".*" + Pattern.quote(suffix()) + ").*");
        Matcher matcher = pattern.matcher(somethingContainingTraces);
        if (!matcher.find()) {
            return "";
        }
        return matcher.group(1);
    }
Can be used to extract traces from a traced string.

@param somethingContainingTraces something containing traces
@return trace of something containing traces or "" if not traces available
code-generation/language-base-freemarker/src/main/java/org/apache/plc4x/plugins/codegenerator/protocol/freemarker/Tracer.java