// CloneRegexLiteral returns a clone of the RegexLiteral.
554136
func CloneRegexLiteral(r *RegexLiteral) *RegexLiteral {
	if r == nil {
		return nil
	}

	clone := &RegexLiteral{}
	if r.Val != nil {
		clone.Val = regexp.MustCompile(r.Val.String())
	}

	return clone
}
905179
func (t *precompilationTypeChecker) AcceptNumericLiteral(v tree.NumericLiteral) {
	if v.Value > 0xFFFFFFFF {
		t.result = fmt.Errorf("no literals larger than 0xFFFFFFFF allowed - this is probably a programmer error: 0x%X", v.Value)
	}
}
842287
func (b ValExprBuilder) RegExp(val interface{}) BoolExprBuilder {
	return b.makeComparisonExpr(astRegExp, makeValExpr(val))
}
777470
func (s *MetricDefinition) SetRegex(v string) *MetricDefinition {
	s.Regex = &v
	return s
}
110177
func (c *Constant) Clone() Expression {
	if c.DeferredExpr != nil {
		con := *c
		return &con
	}
	return c
}
481088
func (msg *Message) CloneOriginal() *Message {
	if msg.orig == nil {
		msg.FreezeOriginal()
	}

	clone := *msg
	clone.data.payload = make([]byte, len(msg.orig.payload))
	copy(clone.data.payload, msg.orig.payload)

	if msg.orig.metadata != nil {
		clone.data.metadata = msg.orig.metadata.Clone()
	} else {
		clone.data.metadata = nil
	}

	clone.SetStreamID(msg.origStreamID)
	return &clone
}
704817
func textRegexSelector(rx *regexp.Regexp) Selector {
	return func(n *html.Node) bool {
		return rx.MatchString(nodeText(n))
	}
}
1000264
func NewRegexpQuery(name string, regexp string) RegexpQuery {
	return RegexpQuery{name: name, regexp: regexp}
}
1213239
func (l *Logger) Clone() *Logger {
	return &Logger{
		Prefix:     l.Prefix,
		Level:      l.Level,
		TimeFormat: l.TimeFormat,
		Printer:    l.Printer,
		handlers:   l.handlers,
		children:   newLoggerMap(),
		mu:         sync.Mutex{},
		once:       sync.Once{},
	}
}
895128
func matchRegexp(rx interface{}, str interface{}) bool {

	var r *regexp.Regexp
	if rr, ok := rx.(*regexp.Regexp); ok {
		r = rr
	} else {
		r = regexp.MustCompile(fmt.Sprint(rx))
	}

	return (r.FindStringIndex(fmt.Sprint(str)) != nil)

}
123270
func NewHexLiteral(s string) (HexLiteral, error) {
	h, err := ParseHexStr(s)
	if err != nil {
		return HexLiteral{}, err
	}
	return HexLiteral(h), nil
}
391165
func (e CNFExprs) Clone() CNFExprs {
	cnf := make(CNFExprs, 0, len(e))
	for _, expr := range e {
		cnf = append(cnf, expr.Clone())
	}
	return cnf
}
475169
func (c Config) metaRegexp() (*regexp.Regexp, error) {
	meta := regexp.QuoteMeta(string([]byte{c.Star, c.Quest, c.Range}))
	return regexp.Compile(`(^|[^\\])[` + meta + `]`)
}
328900
func (set LiteralFieldSet) Clone() LiteralFieldSet {
	clonedSet := NewLiteralFieldSet()
	for elem := range set {
		clonedSet.Add(elem)
	}
	return clonedSet
}
257857
func (p *parserMixin) RegexpList() (target *[]*regexp.Regexp) {
	target = new([]*regexp.Regexp)
	p.RegexpListVar(target)
	return
}
1234028
func (l *Logger) Clone() *Logger {
	newLogger, _ := l.client.NewLogger()

	for attrKey, attrVal := range l.attrs {
		newLogger.SetAttr(attrKey, attrVal)
	}

	return newLogger
}
384224
func NewRegexpRule(re string, t TokenType, subTypes []TokenType,
	next []string) RegexpRule {
	return RegexpRule{
		Regexp:     regexp.MustCompile(re),
		Type:       t,
		SubTypes:   subTypes,
		NextStates: next,
	}
}