// Load creates a new regex expectation
Load creates a new regex expectation
// Load creates a new regex expectation
func (r *regexExpectation) Load(data map[string]string) Expectation {
	var err error
	r.raw = data["pattern"]
	r.regex, err = regexp.Compile(r.raw)
	if err != nil {
		e := errorExpectation{}
		return e.Load(map[string]string{
			"msg": fmt.Sprintf("invalid regex: %s (%s)", r.raw, err),
		})
	}
	return r
}
func ( r * regexExpectation ) Load ( data map [ string ] string ) Expectation { var err error r . raw = data [ " " ] r . regex , err = regexp . Compile ( r . raw ) if err != nil { e := errorExpectation { } return e . Load ( map [ string ] string { " " : fmt . Sprintf ( " " , r . raw , err ) , } ) } return r }
Load creates a new regex expectation
Load creates a new regex expectation