// File generated by regexp2go. DO NOT EDIT.
// regexp2go -flags=212 -pkg="plain" -fn="Match" -pool=true "plain"

package plain

import "regexp/syntax"
import "strings"
import "bytes"

const MatchRegexp = "plain"

var (
	_ = syntax.IsWordChar
	_ = strings.Index
)

type modeTypeMatch uint8

const (
	modeMatchMatch modeTypeMatch = iota
	modeFirstMatch
	modeLongestMatch
)

// Match implements the regular expression
// "plain"
// with flags 212.
type Match struct{}

// FindString returns the first leftmost match.
func (e Match) FindString(r string) (matches [1]string, pos int, ok bool) {
	pos = strings.Index(r, "plain")
	if pos >= 0 {
		matches[0], ok = r[pos:pos+5], true
	} else {
		pos = 0
	}
	return
}

// FindLongestString returns the leftmost-longest match.
func (e Match) FindLongestString(r string) (matches [1]string, pos int, ok bool) {
	return e.FindString(r)
}

// Find returns the first leftmost match.
func (e Match) Find(s []byte) (matches [1][]byte, pos int, ok bool) {
	pos = bytes.Index(s, []byte("plain"))
	if pos >= 0 {
		matches[0], ok = s[pos:pos+5], true
	} else {
		pos = 0
	}
	return
}

// FindLongest returns the leftmost-longest match.
func (e Match) FindLongest(s []byte) (matches [1][]byte, pos int, ok bool) {
	return e.Find(s)
}
