codesearch: Index | Files

package regexp

import ""

Package regexp implements regular expression search tuned for use in grep-like programs.


Package Files

copy.go match.go regexp.go utf.go

type Grep Uses

type Grep struct {
    Regexp *Regexp   // regexp to search for
    Stdout io.Writer // output target
    Stderr io.Writer // error target

    L   bool // L flag - print file names only
    C   bool // C flag - print count of matches
    N   bool // N flag - print line numbers
    H   bool // H flag - do not print file names

    Match bool
    // contains filtered or unexported fields


func (*Grep) AddFlags Uses

func (g *Grep) AddFlags()

func (*Grep) File Uses

func (g *Grep) File(name string)

func (*Grep) Reader Uses

func (g *Grep) Reader(r io.Reader, name string)

type Regexp Uses

type Regexp struct {
    Syntax *syntax.Regexp
    // contains filtered or unexported fields

Regexp is the representation of a compiled regular expression. A Regexp is NOT SAFE for concurrent use by multiple goroutines.

func Compile Uses

func Compile(expr string) (*Regexp, error)

Compile parses a regular expression and returns, if successful, a Regexp object that can be used to match against lines of text.

func (*Regexp) Match Uses

func (r *Regexp) Match(b []byte, beginText, endText bool) (end int)

func (*Regexp) MatchString Uses

func (r *Regexp) MatchString(s string, beginText, endText bool) (end int)

func (*Regexp) String Uses

func (re *Regexp) String() string

String returns the source text used to compile the regular expression.

Package regexp imports 12 packages (graph) and is imported by 9 packages. Updated 2019-04-11. Refresh now. Tools for package owners.