Home | History | Annotate | Download | only in regexp

Lines Matching defs:String

27 //	Find(All)?(String)?(Submatch)?(Index)?
36 // If 'String' is present, the argument is a string; otherwise it is a slice
47 // pairs within the input string: result[2*n:2*n+1] identifies the indexes of
51 // subexpression did not match any string in the input.
90 expr string // as passed to Compile
93 prefix string // required prefix in unanchored matches
100 subexpNames []string
104 // String returns the source text used to compile the regular expression.
105 func (re *Regexp) String() string {
131 func Compile(expr string) (*Regexp, error) {
154 func CompilePOSIX(expr string) (*Regexp, error) {
166 func compile(expr string, mode syntax.Flags, longest bool) (*Regexp, error) {
234 func MustCompile(str string) *Regexp {
245 func MustCompilePOSIX(str string) *Regexp {
253 func quote(s string) string {
269 // the empty string. The slice should not be modified.
270 func (re *Regexp) SubexpNames() []string {
286 // inputString scans a string.
288 str string
401 // LiteralPrefix returns a literal string that must begin any match
403 // literal string comprises the entire regular expression.
404 func (re *Regexp) LiteralPrefix() (prefix string, complete bool) {
414 // MatchString reports whether the Regexp matches the string s.
415 func (re *Regexp) MatchString(s string) bool {
427 func MatchReader(pattern string, r io.RuneReader) (matched bool, err error) {
436 // matches a string. More complicated queries need
438 func MatchString(pattern string, s string) (matched bool, err error) {
449 func Match(pattern string, b []byte) (matched bool, err error) {
458 // with the replacement string repl. Inside repl, $ signs are interpreted as
460 func (re *Regexp) ReplaceAllString(src, repl string) string {
468 return string(b)
472 // with the replacement string repl. The replacement repl is substituted directly,
474 func (re *Regexp) ReplaceAllLiteralString(src, repl string) string {
475 return string(re.replaceAll(nil, src, 2, func(dst []byte, match []int) []byte {
484 func (re *Regexp) ReplaceAllStringFunc(src string, repl func(string) string) string {
488 return string(b)
491 func (re *Regexp) replaceAll(bsrc []byte, src string, nmatch int, repl func(dst []byte, m []int) []byte) []byte {
519 // Now insert a copy of the replacement string, but not for a
520 // match of the empty string
539 // string. In that case, DecodeRuneInString returns width=0.
567 srepl = string(repl)
599 // QuoteMeta returns a string that quotes all regular expression metacharacters
600 // inside the argument text; the returned string is a regular expression matching
602 func QuoteMeta(s string) string {
610 // No meta characters found, so return original string.
626 return string(b[:j])
646 // Find matches in slice b if b is non-nil, otherwise find matches in string s.
647 func (re *Regexp) allMatches(s string, b []byte, n int, deliver func([]int)) {
716 // FindString returns a string holding the text of the leftmost match in s of the regular
717 // expression. If there is no match, the return value is an empty string,
719 // an empty string. Use FindStringIndex or FindStringSubmatch if it is
721 func (re *Regexp) FindString(s string) string {
734 func (re *Regexp) FindStringIndex(s string) (loc []int) {
793 return re.expand(dst, string(template), src, "", match)
799 func (re *Regexp) ExpandString(dst []byte, template string, src string, match []int) []byte {
803 func (re *Regexp) expand(dst []byte, template string, bsrc []byte, src string, match []int) []byte {
852 func extract(str string) (name string, num int, rest string, ok bool) {
917 func (re *Regexp) FindStringSubmatch(s string) []string {
923 ret := make([]string, 1+re.numSubexp)
937 func (re *Regexp) FindStringSubmatchIndex(s string) []int {
992 func (re *Regexp) FindAllString(s string, n int) []string {
996 result := make([]string, 0, startSize)
1010 func (re *Regexp) FindAllStringIndex(s string, n int) [][]int {
1070 func (re *Regexp) FindAllStringSubmatch(s string, n int) [][]string {
1074 result := make([][]string, 0, startSize)
1076 string, len(match)/2)
1095 func (re *Regexp) FindAllStringSubmatchIndex(s string, n int) [][]int {
1124 func (re *Regexp) Split(s string, n int) []string {
1131 return []string{""}
1135 strings := make([]string, 0, len(matches))