Documentation ¶
Overview ¶
Package lazyregexp is a thin wrapper over regexp, allowing the use of global regexp variables without forcing them to be compiled at init.
Index ¶
- func IsCodeRe(b string) bool
- func IsEmailRe(b string) bool
- func IsIpv4Re(b string) bool
- func IsUrlRe(b string) bool
- func TrimHtml(src string) string
- type Regexp
- func (r *Regexp) Find(b []byte) []byte
- func (r *Regexp) FindAll(b []byte, n int) [][]byte
- func (r *Regexp) FindAllIndex(b []byte, n int) [][]int
- func (r *Regexp) FindAllString(s string, n int) []string
- func (r *Regexp) FindAllStringSubmatch(s string, n int) [][]string
- func (r *Regexp) FindString(s string) string
- func (r *Regexp) FindStringSubmatch(s string) []string
- func (r *Regexp) FindStringSubmatchIndex(s string) []int
- func (r *Regexp) FindSubmatch(s []byte) [][]byte
- func (r *Regexp) Match(b []byte) bool
- func (r *Regexp) MatchString(s string) bool
- func (r *Regexp) Regexp() *regexp.Regexp
- func (r *Regexp) ReplaceAll(src, repl []byte) []byte
- func (r *Regexp) ReplaceAllLiteralString(src, repl string) string
- func (r *Regexp) ReplaceAllString(src, repl string) string
- func (r *Regexp) ReplaceAllStringFunc(src string, repl func(string) string) string
- func (r *Regexp) Split(s string, n int) []string
- func (r *Regexp) SubexpNames() []string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 ¶
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) FindAllStringSubmatch ¶
func (*Regexp) FindString ¶
func (*Regexp) FindStringSubmatch ¶
func (*Regexp) FindStringSubmatchIndex ¶
func (*Regexp) FindSubmatch ¶
func (*Regexp) MatchString ¶
func (*Regexp) ReplaceAll ¶
func (*Regexp) ReplaceAllLiteralString ¶
func (*Regexp) ReplaceAllString ¶
func (*Regexp) ReplaceAllStringFunc ¶
func (*Regexp) SubexpNames ¶
Click to show internal directories.
Click to hide internal directories.