INNER CODE UNIT · Go

Regexp

Netflix/go-expect · expect_opt.go:257

func Regexp(res ...*regexp.Regexp) ExpectOpt {
	return func(opts *ExpectOpts) error {
		for _, re := range res {
			opts.Matchers = append(opts.Matchers, &regexpMatcher{
				re: re,
			})
		}
		return nil
	}
}

// RegexpPattern adds an Expect condition to exit if the content read from
// Console's tty matches the given Regexp patterns. Expect returns an error if
// the patterns were unsuccessful in compiling the Regexp.
func RegexpPattern(ps ...string) ExpectOpt {
	return func(opts *ExpectOpts) error {
		var res []*regexp.Regexp
		for _, p := range ps {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…