class EmbeddedFlagUtil {

    public String embedFlags(String regex, int flags) {
        if (flags == 0) {
            return regex;
        } else {
            return "(?" + mapFlagsToEmbeddedFlags(flags) + ":" + regex + ")";
        }
    }

}