Documentation ¶
Index ¶
- func Escape(re string) string
- func IsValid(str []byte) bool
- func IsValidPointer(str *[]byte) bool
- func JoinBytes(bytes ...interface{}) []byte
- type PCRE
- type Regexp
- func (reg *Regexp) Match(str []byte) bool
- func (reg *Regexp) MatchPointer(str *[]byte) bool
- func (reg *Regexp) ReplaceFunc(str []byte, rep func(data func(int) []byte) []byte, blank ...bool) []byte
- func (reg *Regexp) ReplaceFuncFirst(str []byte, rep func(func(int) []byte) []byte, blank ...bool) []byte
- func (reg *Regexp) ReplaceFuncPointer(str *[]byte, rep func(data func(int) []byte) []byte, blank ...bool) []byte
- func (reg *Regexp) ReplaceString(str []byte, rep []byte) []byte
- func (reg *Regexp) ReplaceStringComplex(str []byte, rep []byte) []byte
- func (reg *Regexp) ReplaceStringComplexPointer(str *[]byte, rep []byte) []byte
- func (reg *Regexp) ReplaceStringComplexPointerWithResultPointer(str *[]byte, rep *[]byte) []byte
- func (reg *Regexp) ReplaceStringPointer(str *[]byte, rep []byte) []byte
- func (reg *Regexp) ReplaceStringPointerWithResultPointer(str *[]byte, rep *[]byte) []byte
- func (reg *Regexp) Split(str []byte) [][]byte
- func (reg *Regexp) SplitPointer(str *[]byte) [][]byte
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsValidPointer ¶ added in v4.2.0
Types ¶
type Regexp ¶
type Regexp struct {
RE *pcre.Regexp
}
func (*Regexp) MatchPointer ¶
MatchRef returns true if a string matches a regex Uses Pointers For Improved Performance
func (*Regexp) ReplaceFunc ¶
func (reg *Regexp) ReplaceFunc(str []byte, rep func(data func(int) []byte) []byte, blank ...bool) []byte
RepFunc replaces a string with the result of a function similar to JavaScript .replace(/re/, function(data){})
func (*Regexp) ReplaceFuncFirst ¶
func (reg *Regexp) ReplaceFuncFirst(str []byte, rep func(func(int) []byte) []byte, blank ...bool) []byte
RepFuncFirst is a copy of the RepFunc method modified to only run once
func (*Regexp) ReplaceFuncPointer ¶
func (reg *Regexp) ReplaceFuncPointer(str *[]byte, rep func(data func(int) []byte) []byte, blank ...bool) []byte
RepFuncRef replace a string with the result of a function similar to JavaScript .replace(/re/, function(data){}) Uses Pointers For Improved Performance
func (*Regexp) ReplaceString ¶
RepStr replaces a string with another string note: this function is optimized for performance, and the replacement string does not accept replacements like $1
func (*Regexp) ReplaceStringComplex ¶
RepStrComplex is a more complex version of the RepStr method this function will replace things in the result like $1 with your capture groups use $0 to use the full regex capture group use ${123} to use numbers with more than one digit
func (*Regexp) ReplaceStringComplexPointer ¶
RepStrComplexRef is a more complex version of the RepStrRef method this function will replace things in the result like $1 with your capture groups use $0 to use the full regex capture group use ${123} to use numbers with more than one digit Uses Pointers For Improved Performance
func (*Regexp) ReplaceStringComplexPointerWithResultPointer ¶
RepStrComplexRefRes is a more complex version of the RepStrRefRes method this function will replace things in the result like $1 with your capture groups use $0 to use the full regex capture group use ${123} to use numbers with more than one digit Uses Pointers For Improved Performance (also on result)
func (*Regexp) ReplaceStringPointer ¶
RepStrRef replaces a string with another string note: this function is optimized for performance, and the replacement string does not accept replacements like $1 Uses Pointers For Improved Performance
func (*Regexp) ReplaceStringPointerWithResultPointer ¶
RepStrRefRes replaces a string with another string note: this function is optimized for performance, and the replacement string does not accept replacements like $1 Uses Pointers For Improved Performance (also on result)
func (*Regexp) Split ¶
Split splits a string, and keeps capture groups Similar to JavaScript .split(/re/)
func (*Regexp) SplitPointer ¶
SplitRef splits a string, and keeps capture groups Similar to JavaScript .split(/re/) Uses Pointers For Improved Performance