Documentation ¶
Index ¶
- func AutoInstallLinuxDependencies()
- func Escape(re string) string
- func IsValid(str []byte) bool
- func IsValidRef(str *[]byte) bool
- func JoinBytes(bytes ...interface{}) []byte
- type PCRE
- type Regexp
- func (reg *Regexp) Match(str []byte) bool
- func (reg *Regexp) MatchRef(str *[]byte) bool
- func (reg *Regexp) RepFunc(str []byte, rep func(data func(int) []byte) []byte, blank ...bool) []byte
- func (reg *Regexp) RepFuncFirst(str []byte, rep func(func(int) []byte) []byte, blank ...bool) []byte
- func (reg *Regexp) RepFuncRef(str *[]byte, rep func(data func(int) []byte) []byte, blank ...bool) []byte
- func (reg *Regexp) RepStr(str []byte, rep []byte) []byte
- func (reg *Regexp) RepStrComp(str []byte, rep []byte) []byte
- func (reg *Regexp) RepStrCompRef(str *[]byte, rep []byte) []byte
- func (reg *Regexp) RepStrCompRefRes(str *[]byte, rep *[]byte) []byte
- func (reg *Regexp) RepStrComplex(str []byte, rep []byte) []byte
- func (reg *Regexp) RepStrComplexRef(str *[]byte, rep []byte) []byte
- func (reg *Regexp) RepStrComplexRefRes(str *[]byte, rep *[]byte) []byte
- func (reg *Regexp) RepStrRef(str *[]byte, rep []byte) []byte
- func (reg *Regexp) RepStrRefRes(str *[]byte, rep *[]byte) []byte
- func (reg *Regexp) Split(str []byte) [][]byte
- func (reg *Regexp) SplitRef(str *[]byte) [][]byte
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AutoInstallLinuxDependencies ¶
func AutoInstallLinuxDependencies()
AutoInstallLinuxDependencies will automatically detect and install dependencies if missing from debian or arch linux debian: libpcre3-dev arch: pcre-dev
func IsValidRef ¶ added in v4.2.0
Types ¶
type Regexp ¶
type Regexp struct {
RE *pcre.Regexp
}
func (*Regexp) MatchRef ¶
MatchRef returns true if a string matches a regex Uses Pointers For Improved Performance
func (*Regexp) RepFunc ¶
func (reg *Regexp) RepFunc(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) RepFuncFirst ¶
func (reg *Regexp) RepFuncFirst(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) RepFuncRef ¶
func (reg *Regexp) RepFuncRef(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) RepStr ¶
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) RepStrComp ¶ added in v4.1.0
An alias for RepStrComplex
func (*Regexp) RepStrCompRef ¶ added in v4.1.0
An alias for RepStrComplexRef
func (*Regexp) RepStrCompRefRes ¶ added in v4.1.0
An alias for RepStrComplexRefRes
func (*Regexp) RepStrComplex ¶
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) RepStrComplexRef ¶
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) RepStrComplexRefRes ¶
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) RepStrRef ¶
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) RepStrRefRes ¶
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)