toolsgolang.org/x/tools/internal/mod/lazyregexp Index | Files

package lazyregexp

import "golang.org/x/tools/internal/mod/lazyregexp"

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

Index

Types

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) MatchString

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

Source Files

lazyre.go

Version
v0.1.8
Published
Dec 2, 2021
Platform
js/wasm
Imports
4 packages
Last checked
3 hours ago

Tools for package owners.