You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: regexp.go
    path of file: ./repos/fq/internal/gojqex
    
    the code of the file until where you have to start completion: package gojqex

import (
	"fmt"
	"regexp"
	"strings"
)

// from gojq, see https://github.com/itchyny/gojq/blob/main/LICENSE
func CompileRegexp(re, allowedFlags, flags string) (*regexp.Regexp, error) {
	if strings.IndexFunc(flags, func(r rune) bool {
		return !strings.Contain
    
func CompileRegexp(re, allowedFlags, flags string) (*regexp.Regexp, error) {
	if strings.IndexFunc(flags, func(r rune) bool {
		return !strings.ContainsAny(string([]rune{r}), allowedFlags)
	}) >= 0 {
		return nil, fmt.Errorf("unsupported regular expression flag: %q", flags)
	}
	re = strings.ReplaceAll(re, "(?<", "(?P<")
	if strings.ContainsRune(flags, 'i') {
		re = "(?i)" + re
	}
	if strings.ContainsRune(flags, 'm') {
		re = "(?s)" + re
	}
	r, err := regexp.Compile(re)
	if err != nil {
		return nil, fmt.Errorf("invalid regular expression %q: %w", re, err)
	}
	return r, nil
}