Documentation ¶
Index ¶
- func IsMatch(pattern string, src []byte) bool
- func IsMatchString(pattern string, src string) bool
- func Match(pattern string, src []byte) ([][]byte, error)
- func MatchAll(pattern string, src []byte) ([][][]byte, error)
- func MatchAllString(pattern string, src string) ([][]string, error)
- func MatchString(pattern string, src string) ([]string, error)
- func Quote(s string) string
- func Replace(pattern string, replace, src []byte) ([]byte, error)
- func ReplaceFunc(pattern string, src []byte, replaceFunc func(b []byte) []byte) ([]byte, error)
- func ReplaceFuncMatch(pattern string, src []byte, replaceFunc func(match [][]byte) []byte) ([]byte, error)
- func ReplaceString(pattern, replace, src string) (string, error)
- func ReplaceStringFunc(pattern string, src string, replaceFunc func(s string) string) (string, error)
- func ReplaceStringFuncMatch(pattern string, src string, replaceFunc func(match []string) string) (string, error)
- func Split(pattern string, src string) []string
- func Validate(pattern string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsMatchString ¶ added in v0.0.3
IsMatchString 字符串是否匹配
func MatchAllString ¶ added in v0.1.9
MatchAllString return all strings that matched <pattern>.
func MatchString ¶
MatchString 返回<pattern>匹配的字符串
func ReplaceFunc ¶
ReplaceFunc 使用自定义func按照规则替换数据
func ReplaceFuncMatch ¶ added in v0.1.9
func ReplaceFuncMatch(pattern string, src []byte, replaceFunc func(match [][]byte) []byte) ([]byte, error)
ReplaceFuncMatch replace all matched <pattern> in bytes <src> with custom replacement function <replaceFunc>. The parameter <match> type for <replaceFunc> is [][]byte, which is the result contains all sub-patterns of <pattern> using Match function.
func ReplaceString ¶ added in v0.0.3
ReplaceString 使用正则匹配替换字符串
func ReplaceStringFunc ¶
func ReplaceStringFunc(pattern string, src string, replaceFunc func(s string) string) (string, error)
ReplaceStringFunc replace all matched <pattern> in string <src> with custom replacement function <replaceFunc>.
func ReplaceStringFuncMatch ¶ added in v0.1.9
func ReplaceStringFuncMatch(pattern string, src string, replaceFunc func(match []string) string) (string, error)
ReplaceStringFuncMatch replace all matched <pattern> in string <src> with custom replacement function <replaceFunc>. The parameter <match> type for <replaceFunc> is []string, which is the result contains all sub-patterns of <pattern> using MatchString function.
Types ¶
This section is empty.