static FEELFnResult<Boolean> matchFunctionWithFlags(String input, String pattern, String flags) {
        log.debug("Input:  {} , Pattern: {}, Flags: {}", input, pattern, flags);
        if ( input == null ) {
            throw new InvalidParameterException("input");
        }
        if ( pattern == null ) {
            throw new InvalidParameterException("pattern");
        }
            final String flagsString;
            if (flags != null && !flags.isEmpty()) {
                checkFlags(flags);
                if(!flags.contains("U")){
                    flags += "U";
                }
                flagsString = String.format("(?%s)", flags);
            } else {
                flagsString = "";
            }
            log.debug("flagsString: {}", flagsString);
            String stringToBeMatched = flagsString + pattern;
            log.debug("stringToBeMatched: {}", stringToBeMatched);
            Pattern p=Pattern.compile(stringToBeMatched);
            Matcher m = p.matcher( input );
            boolean matchFound=m.find();
            log.debug("matchFound: {}", matchFound);
            return FEELFnResult.ofResult(matchFound);
    }
@Test
    void invokeWithoutFlagsMatch() {
        FunctionTestUtil.assertResult(MatchesFunction.matchFunctionWithFlags("test", "test",null), true);
        FunctionTestUtil.assertResult(MatchesFunction.matchFunctionWithFlags("foobar", "^fo*b",null), true);
        FunctionTestUtil.assertResult(MatchesFunction.matchFunctionWithFlags("abracadabra", "bra", ""), true);
        FunctionTestUtil.assertResult(MatchesFunction.matchFunctionWithFlags("abracadabra", "bra",null), true);
        FunctionTestUtil.assertResult(MatchesFunction.matchFunctionWithFlags("(?xi)[hello world()]", "hello",null), true);
    }