regexp

package
v0.0.0-...-633034c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 22, 2016 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UnescapeUnicode

func UnescapeUnicode(pattern string) string

Types

type Matcher

type Matcher struct {
	*pcre.Matcher
}

type Regexp

type Regexp struct {
	// contains filtered or unexported fields
}

func Compile

func Compile(pattern, flags string) (*Regexp, error)

func CompileParse

func CompileParse(pattern string) (*Regexp, error)

func MustCompile

func MustCompile(pattern string) *Regexp

func (*Regexp) FindAllIndex

func (re *Regexp) FindAllIndex(bytes []byte, flags int) [][]int

FindAllIndex returns the start and end of the first match.

func (*Regexp) FindAllStringIndex

func (re *Regexp) FindAllStringIndex(str string, _ ...int) [][]int

func (*Regexp) FindAllStringSubmatchIndex

func (re *Regexp) FindAllStringSubmatchIndex(s string, _ int) [][]int

func (*Regexp) FindAllSubmatchIndex

func (re *Regexp) FindAllSubmatchIndex(b []byte, _ int) [][]int

func (*Regexp) FindIndex

func (re *Regexp) FindIndex(bytes []byte, flags int) []int

FindIndex returns the start and end of the first match, or nil if no match. loc[0] is the start and loc[1] is the end.

func (*Regexp) FindString

func (re *Regexp) FindString(s string, flags int) string

FindString returns the start and end of the first match, or nil if no match. loc[0] is the start and loc[1] is the end.

func (*Regexp) FindStringIndex

func (re *Regexp) FindStringIndex(s string) []int

func (*Regexp) FindStringSubmatchIndex

func (re *Regexp) FindStringSubmatchIndex(s string) (indexPairs []int)

func (Regexp) Groups

func (re Regexp) Groups() int

Groups returns the number of capture groups in the compiled regexp pattern.

func (*Regexp) IsCaseless

func (re *Regexp) IsCaseless() bool

IsCaseless checks if regexp is case insensetive

func (*Regexp) IsMultiline

func (re *Regexp) IsMultiline() bool

IsMultiline checks if regexp is multiline

func (*Regexp) Match

func (re *Regexp) Match(subject []byte, flags int) bool

Match tries to match the speficied byte array slice to the current pattern. Returns true if the match succeeds.

func (*Regexp) MatchString

func (re *Regexp) MatchString(subject string, flags int) bool

MatchString is same as Match, but accept string as argument

func (*Regexp) Matcher

func (re *Regexp) Matcher(subject []byte, flags int) (m *Matcher)

Matcher returns a new matcher object, with the byte array slice as a subject.

func (*Regexp) MatcherString

func (re *Regexp) MatcherString(subject string, flags int) (m *Matcher)

MatcherString returns a new matcher object, with the specified subject string.

func (*Regexp) ReplaceAll

func (re *Regexp) ReplaceAll(bytes, repl []byte, flags int) []byte

ReplaceAll returns a copy of a byte slice with pattern matches replaced by repl.

func (*Regexp) ReplaceAllString

func (re *Regexp) ReplaceAllString(src, repl string, flags int) string

ReplaceAllString is same as ReplaceAll, but accept strings as arguments

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL