package standard library
go1.22.3 Latest Latest

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

Go to latest
Published: May 7, 2024 License: BSD-3-Clause Imports: 4 Imported by: 0



Package lazyregexp is a thin wrapper over regexp, allowing the use of global regexp variables without forcing them to be compiled at init.



This section is empty.


This section is empty.


This section is empty.


type Regexp

type Regexp struct {
	// contains filtered or unexported fields

Regexp is a wrapper around regexp.Regexp, where the underlying regexp will be compiled the first time it is needed.

func New

func New(str string) *Regexp

New creates a new lazy regexp, delaying the compiling work until it is first needed. If the code is being run as part of tests, the regexp compiling will happen immediately.

func (*Regexp) FindAllString

func (r *Regexp) FindAllString(s string, n int) []string

func (*Regexp) FindString

func (r *Regexp) FindString(s string) string

func (*Regexp) FindStringSubmatch

func (r *Regexp) FindStringSubmatch(s string) []string

func (*Regexp) FindStringSubmatchIndex

func (r *Regexp) FindStringSubmatchIndex(s string) []int

func (*Regexp) FindSubmatch

func (r *Regexp) FindSubmatch(s []byte) [][]byte

func (*Regexp) MatchString

func (r *Regexp) MatchString(s string) bool

func (*Regexp) ReplaceAllString

func (r *Regexp) ReplaceAllString(src, repl string) string

func (*Regexp) SubexpNames

func (r *Regexp) SubexpNames() []string

Jump to

Keyboard shortcuts

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