NewMatch returns a new Match instance. If reporter is nil, the function panics. Both submatchValues and submatchNames may be nil. Example: s := "http://example.com/users/john" r := regexp.MustCompile(`http://(?P .+)/users/(?P .+)`) m := NewMatch(t, r.FindStringSubmatch(s), r.SubexpN
(reporter Reporter, submatchValues []string, submatchNames []string)
| 34 | // m.NamedSubmatch("host").IsEqual("example.com") |
| 35 | // m.NamedSubmatch("user").IsEqual("john") |
| 36 | func NewMatch(reporter Reporter, submatchValues []string, submatchNames []string) *Match { |
| 37 | return newMatch( |
| 38 | newChainWithDefaults("Match()", reporter), submatchValues, submatchNames) |
| 39 | } |
| 40 | |
| 41 | // NewMatchC returns a new Match instance with config. |
| 42 | // |
searching dependent graphs…