Documentation ¶
Index ¶
- func Escape(re string) string
- func IsValid(str []byte) bool
- func JoinBytes(bytes ...interface{}) []byte
- type PCRE
- type RE2
- type Regexp
- func (reg *Regexp) Match(str []byte) bool
- func (reg *Regexp) RepFunc(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) Split(str []byte) [][]byte
- type RegexpPCRE
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Regexp ¶
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) 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 ¶
RepStrComp 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
type RegexpPCRE ¶
type RegexpPCRE struct {
RE *pcre.Regexp
}
func (*RegexpPCRE) RepFunc ¶
func (reg *RegexpPCRE) 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 (*RegexpPCRE) RepStrComp ¶
func (reg *RegexpPCRE) RepStrComp(str []byte, rep []byte) []byte
RepStrComp 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