Documentation
¶
Index ¶
- func Escape(re string) string
- func IsValid(str []byte) bool
- func JoinBytes(bytes ...interface{}) []byte
- type RE2
- type Regexp
- func (reg *Regexp) Match(str []byte) bool
- func (reg *Regexp) ReplaceFunc(str []byte, rep func(data func(int) []byte) []byte, blank ...bool) []byte
- func (reg *Regexp) ReplaceString(str []byte, rep []byte) []byte
- func (reg *Regexp) ReplaceStringLiteral(str []byte, rep []byte) []byte
- func (reg *Regexp) Split(str []byte) [][]byte
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Regexp ¶
func CompileTry ¶
CompTry tries to compile or returns an error
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) ReplaceString ¶
ReplaceString 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) ReplaceStringLiteral ¶
ReplaceStringLiteral replaces a string with another string
@rep uses the literal string, and does Not use args like $1
Click to show internal directories.
Click to hide internal directories.