Documentation
¶
Index ¶
- func Expand(d, template []byte, r *regexp.Regexp, n int) []byte
- func ExpandAll(d, template []byte, r *regexp.Regexp) []byte
- func ExpandAllString(d, template string, r *regexp.Regexp) string
- func ExpandAllStringWithPattern(d, template string, pattern string) string
- func ExpandAllWithPattern(d, template []byte, pattern string) []byte
- func ExpandString(d, template string, r *regexp.Regexp, n int) string
- func ExpandStringWithPattern(d, template string, pattern string, n int) string
- func ExpandWithPattern(d, template []byte, pattern string, n int) []byte
- func Find(d []byte, r *regexp.Regexp, n int) [][]byte
- func FindAll(d []byte, r *regexp.Regexp) [][]byte
- func FindAllIndex(d []byte, r *regexp.Regexp) []*pair.Pair[int, int]
- func FindAllIndexForString(d string, r *regexp.Regexp) []*pair.Pair[int, int]
- func FindAllIndexForStringWithPattern(d string, pattern string) []*pair.Pair[int, int]
- func FindAllIndexWithPattern(d []byte, pattern string) []*pair.Pair[int, int]
- func FindAllString(d string, r *regexp.Regexp) []string
- func FindAllStringWithPattern(d string, pattern string) []string
- func FindAllSubMatches(d []byte, r *regexp.Regexp) [][][]byte
- func FindAllSubMatchesForString(d string, r *regexp.Regexp) [][]string
- func FindAllSubMatchesForStringWithPattern(d string, pattern string) [][]string
- func FindAllSubMatchesWithPattern(d []byte, pattern string) [][][]byte
- func FindAllSubMatchingIndices(d []byte, r *regexp.Regexp) [][]*pair.Pair[int, int]
- func FindAllSubMatchingIndicesForString(d string, r *regexp.Regexp) [][]*pair.Pair[int, int]
- func FindAllSubMatchingIndicesForStringWithPattern(d string, pattern string) [][]*pair.Pair[int, int]
- func FindAllSubMatchingIndicesWithPattern(d []byte, pattern string) [][]*pair.Pair[int, int]
- func FindAllWithPattern(d []byte, pattern string) [][]byte
- func FindFirst(d []byte, r *regexp.Regexp) []byte
- func FindFirstIndex(d []byte, r *regexp.Regexp) *pair.Pair[int, int]
- func FindFirstIndexForString(d string, r *regexp.Regexp) *pair.Pair[int, int]
- func FindFirstIndexForStringWithPattern(d string, pattern string) *pair.Pair[int, int]
- func FindFirstIndexWithPattern(d []byte, pattern string) *pair.Pair[int, int]
- func FindFirstString(d string, r *regexp.Regexp) string
- func FindFirstStringWithPattern(d string, pattern string) string
- func FindFirstSubMatch(d []byte, r *regexp.Regexp) [][]byte
- func FindFirstSubMatchForString(d string, r *regexp.Regexp) []string
- func FindFirstSubMatchForStringWithPattern(d string, pattern string) []string
- func FindFirstSubMatchWithPattern(d []byte, pattern string) [][]byte
- func FindFirstSubMatchingIndex(d []byte, r *regexp.Regexp) []*pair.Pair[int, int]
- func FindFirstSubMatchingIndexForString(d string, r *regexp.Regexp) []*pair.Pair[int, int]
- func FindFirstSubMatchingIndexForStringWithPattern(d string, pattern string) []*pair.Pair[int, int]
- func FindFirstSubMatchingIndexWithPattern(d []byte, pattern string) []*pair.Pair[int, int]
- func FindFirstWithPattern(d []byte, pattern string) []byte
- func FindIndex(d []byte, r *regexp.Regexp, n int) []*pair.Pair[int, int]
- func FindIndexForString(d string, r *regexp.Regexp, n int) []*pair.Pair[int, int]
- func FindIndexForStringWithPattern(d string, pattern string, n int) []*pair.Pair[int, int]
- func FindIndexWithPattern(d []byte, pattern string, n int) []*pair.Pair[int, int]
- func FindLast(d []byte, r *regexp.Regexp) []byte
- func FindLastIndex(d []byte, r *regexp.Regexp) *pair.Pair[int, int]
- func FindLastIndexForString(d string, r *regexp.Regexp) *pair.Pair[int, int]
- func FindLastIndexForStringWithPattern(d string, pattern string) *pair.Pair[int, int]
- func FindLastIndexWithPattern(d []byte, pattern string) *pair.Pair[int, int]
- func FindLastString(d string, r *regexp.Regexp) string
- func FindLastStringWithPattern(d string, pattern string) string
- func FindLastSubMatch(d []byte, r *regexp.Regexp) [][]byte
- func FindLastSubMatchForString(d string, r *regexp.Regexp) []string
- func FindLastSubMatchForStringWithPattern(d string, pattern string) []string
- func FindLastSubMatchWithPattern(d []byte, pattern string) [][]byte
- func FindLastSubMatchingIndex(d []byte, r *regexp.Regexp) []*pair.Pair[int, int]
- func FindLastSubMatchingIndexForString(d string, r *regexp.Regexp) []*pair.Pair[int, int]
- func FindLastSubMatchingIndexForStringWithPattern(d string, pattern string) []*pair.Pair[int, int]
- func FindLastSubMatchingIndexWithPattern(d []byte, pattern string) []*pair.Pair[int, int]
- func FindLastWithPattern(d []byte, pattern string) []byte
- func FindString(d string, r *regexp.Regexp, n int) []string
- func FindStringWithPattern(d string, pattern string, n int) []string
- func FindSubMatches(d []byte, r *regexp.Regexp, n int) [][][]byte
- func FindSubMatchesForString(d string, r *regexp.Regexp, n int) [][]string
- func FindSubMatchesForStringWithPattern(d string, pattern string, n int) [][]string
- func FindSubMatchesWithPattern(d []byte, pattern string, n int) [][][]byte
- func FindSubMatchingIndices(d []byte, r *regexp.Regexp, n int) [][]*pair.Pair[int, int]
- func FindSubMatchingIndicesForString(d string, r *regexp.Regexp, n int) [][]*pair.Pair[int, int]
- func FindSubMatchingIndicesForStringWithPattern(d string, pattern string, n int) [][]*pair.Pair[int, int]
- func FindSubMatchingIndicesWithPattern(d []byte, pattern string, n int) [][]*pair.Pair[int, int]
- func FindWithPattern(d []byte, pattern string, n int) [][]byte
- func Match(d []byte, r *regexp.Regexp) bool
- func MatchString(d string, r *regexp.Regexp) bool
- func MatchStringWithPattern(d string, pattern string) bool
- func MatchWithPattern(d []byte, pattern string) bool
- func RemoveAll(d []byte, r *regexp.Regexp) []byte
- func RemoveAllString(s string, r *regexp.Regexp) string
- func RemoveAllStringWithPattern(s, pattern string) string
- func RemoveAllWithPattern(d []byte, pattern string) []byte
- func ReplaceAll(d []byte, r *regexp.Regexp, replacement []byte) []byte
- func ReplaceAllString(s string, r *regexp.Regexp, replacement string) string
- func ReplaceAllStringWithPattern(s, pattern, replacement string) string
- func ReplaceAllWithPattern(d []byte, pattern string, replacement []byte) []byte
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Expand ¶
Expand appends template to the result and during append it replaces variables in the template with n number of matches drawn from the source data d.
In the template, a variable is denoted by a substring of the form $name or ${name}, where name is a non-empty sequence of letters, digits, and underscores. A purely numeric name like $1 refers to the sub-match with the corresponding index; other names refer to capturing parentheses named with the (?P<name>...) syntax. A reference to an out of range or unmatched index or a name that is not present in the regular expression is replaced with an empty slice.
In the $name form, name is taken to be as long as possible: $1x is equivalent to ${1x}, not ${1}x, and, $10 is equivalent to ${10}, not ${1}0.
To insert a literal $ in the output, use $$ in the template.
func ExpandAll ¶
ExpandAll appends template to the result and during append it replaces variables in the template with all the matches drawn from the source data d.
In the template, a variable is denoted by a substring of the form $name or ${name}, where name is a non-empty sequence of letters, digits, and underscores. A purely numeric name like $1 refers to the sub-match with the corresponding index; other names refer to capturing parentheses named with the (?P<name>...) syntax. A reference to an out of range or unmatched index or a name that is not present in the regular expression is replaced with an empty slice.
In the $name form, name is taken to be as long as possible: $1x is equivalent to ${1x}, not ${1}x, and, $10 is equivalent to ${10}, not ${1}0.
To insert a literal $ in the output, use $$ in the template.
func ExpandAllString ¶
ExpandAllString is like ExpandAll but the template and source are strings.
func ExpandAllStringWithPattern ¶
ExpandAllStringWithPattern is like ExpandAllString but instead of a regex, it takes a pattern to match the content.
func ExpandAllWithPattern ¶
ExpandAllWithPattern is like ExpandAll but instead of a regex, it takes a pattern to match the content.
func ExpandString ¶
ExpandString is like Expand but the template and source are strings.
func ExpandStringWithPattern ¶
ExpandStringWithPattern is like ExpandString but instead of a regex, it takes a pattern to match the content.
func ExpandWithPattern ¶
ExpandWithPattern is like Expand but instead of a regex, it takes a pattern to match the content.
func Find ¶
Find returns a slice of max n successive matches in d of the regular expression. A return value of nil indicates no match.
func FindAllIndex ¶
FindAllIndex returns a slice of all successive matching indices in d of the regular expression.
func FindAllIndexForString ¶
FindAllIndexForString is like FindAllIndex but the source d is a string.
func FindAllIndexForStringWithPattern ¶
FindAllIndexForStringWithPattern is like FindAllIndexForString but instead of a regex, it takes a pattern to match the content.
func FindAllIndexWithPattern ¶
FindAllIndexWithPattern is like FindAllIndex but instead of a regex, it takes a pattern to match the content.
func FindAllString ¶
FindAllString is like FindAll but the source d is a string.
func FindAllStringWithPattern ¶
FindAllStringWithPattern is like FindAllString but instead of a regex, it takes a pattern to match the content.
func FindAllSubMatches ¶
FindAllSubMatches returns a slice of slices holding the text of all sub-matches of the regular expression in d and the matches, if any, of its subexpressions, as defined by the 'SubMatch' descriptions in the package comment. A return value of nil indicates no match.
func FindAllSubMatchesForString ¶
FindAllSubMatchesForString is like FindAllSubMatches but the source d is a string.
func FindAllSubMatchesForStringWithPattern ¶
FindAllSubMatchesForStringWithPattern is like FindAllSubMatchesForString but instead of a regex, it takes a pattern to match the content.
func FindAllSubMatchesWithPattern ¶
FindAllSubMatchesWithPattern is like FindAllSubMatches but instead of a regex, it takes a pattern to match the content.
func FindAllSubMatchingIndices ¶
FindAllSubMatchingIndices returns a slice of slices holding the index pairs identifying the all the sub-matches of the regular expression in d and the matches, if any, of its subexpressions, as defined by the 'SubMatch' descriptions in the package comment. A return value of nil indicates no match.
func FindAllSubMatchingIndicesForString ¶
FindAllSubMatchingIndicesForString is like FindAllSubMatchingIndices but the source d is a string.
func FindAllSubMatchingIndicesForStringWithPattern ¶
func FindAllSubMatchingIndicesForStringWithPattern(d string, pattern string) [][]*pair.Pair[int, int]
FindAllSubMatchingIndicesForStringWithPattern is like FindAllSubMatchingIndicesForString but instead of a regex, it takes a pattern to match the content.
func FindAllSubMatchingIndicesWithPattern ¶
FindAllSubMatchingIndicesWithPattern is like FindAllSubMatchingIndices but instead of a regex, it takes a pattern to match the content.
func FindAllWithPattern ¶
FindAllWithPattern is like FindAll but instead of a regex, it takes a pattern to match the content.
func FindFirst ¶
FindFirst returns the leftmost match in d of the regular expression. A return value of nil indicates no match.
func FindFirstIndex ¶
FindFirstIndex returns the leftmost matching index in d of the regular expression. A return value of nil indicates no match.
func FindFirstIndexForString ¶
FindFirstIndexForString is like FindFirstIndex but the source d is a string.
func FindFirstIndexForStringWithPattern ¶
FindFirstIndexForStringWithPattern is like FindFirstIndexForString but instead of a regex, it takes a pattern to match the content.
func FindFirstIndexWithPattern ¶
FindFirstIndexWithPattern is like FindFirstIndex but instead of a regex, it takes a pattern to match the content.
func FindFirstString ¶
FindFirstString is like FindFirst but the source d is a string.
func FindFirstStringWithPattern ¶
FindFirstStringWithPattern is like FindFirstString but instead of a regex, it takes a pattern to match the content.
func FindFirstSubMatch ¶
FindFirstSubMatch returns a slice of slices holding the text of the leftmost sub-match of the regular expression in b and the matches, if any, of its subexpressions, as defined by the 'SubMatch' descriptions in the package comment. A return value of nil indicates no match.
func FindFirstSubMatchForString ¶
FindFirstSubMatchForString is like FindFirstSubMatch but the source d is a string.
func FindFirstSubMatchForStringWithPattern ¶
FindFirstSubMatchForStringWithPattern is like FindFirstSubMatchForString but instead of a regex, it takes a pattern to match the content.
func FindFirstSubMatchWithPattern ¶
FindFirstSubMatchWithPattern is like FindFirstSubMatch but instead of a regex, it takes a pattern to match the content.
func FindFirstSubMatchingIndex ¶
FindFirstSubMatchingIndex returns a slice holding the index pairs identifying the leftmost sub-match of the regular expression in b and the matches, if any, of its subexpressions, as defined by the 'SubMatch'. A return value of nil indicates no match.
func FindFirstSubMatchingIndexForString ¶
FindFirstSubMatchingIndexForString is like FindFirstSubMatchingIndex but the source d is a string.
func FindFirstSubMatchingIndexForStringWithPattern ¶
FindFirstSubMatchingIndexForStringWithPattern is like FindFirstSubMatchingIndexForString but instead of a regex, it takes a pattern to match the content.
func FindFirstSubMatchingIndexWithPattern ¶
FindFirstSubMatchingIndexWithPattern is like FindFirstSubMatchingIndex but instead of a regex, it takes a pattern to match the content.
func FindFirstWithPattern ¶
FindFirstWithPattern is like FindFirst but instead of a regex, it takes a pattern to match the content.
func FindIndex ¶
FindIndex returns a slice of max n successive matching indices in d of the regular expression. A return value of nil indicates no match.
func FindIndexForString ¶
FindIndexForString is like FindIndex but the source d is a string.
func FindIndexForStringWithPattern ¶
FindIndexForStringWithPattern is like FindIndexForString but instead of a regex, it takes a pattern to match the content.
func FindIndexWithPattern ¶
FindIndexWithPattern is like FindIndex but instead of a regex, it takes a pattern to match the content.
func FindLast ¶
FindLast returns the rightmost match in d of the regular expression. A return value of nil indicates no match.
func FindLastIndex ¶
FindLastIndex returns the rightmost matching index in d of the regular expression. A return value of nil indicates no match.
func FindLastIndexForString ¶
FindLastIndexForString is like FindLastIndex but the source d is a string.
func FindLastIndexForStringWithPattern ¶
FindLastIndexForStringWithPattern is like FindLastIndexForString but instead of a regex, it takes a pattern to match the content.
func FindLastIndexWithPattern ¶
FindLastIndexWithPattern is like FindLastIndex but instead of a regex, it takes a pattern to match the content.
func FindLastString ¶
FindLastString is like FindLast but the source d is a string.
func FindLastStringWithPattern ¶
FindLastStringWithPattern is like FindLastString but instead of a regex, it takes a pattern to match the content.
func FindLastSubMatch ¶
FindLastSubMatch returns a slice of slices holding the text of the rightmost sub-match of the regular expression in b and the matches, if any, of its subexpressions, as defined by the 'SubMatch' descriptions in the package comment. A return value of nil indicates no match.
func FindLastSubMatchForString ¶
FindLastSubMatchForString is like FindLastSubMatch but the source d is a string.
func FindLastSubMatchForStringWithPattern ¶
FindLastSubMatchForStringWithPattern is like FindLastSubMatchForString but instead of a regex, it takes a pattern to match the content.
func FindLastSubMatchWithPattern ¶
FindLastSubMatchWithPattern is like FindLastSubMatch but instead of a regex, it takes a pattern to match the content.
func FindLastSubMatchingIndex ¶
FindLastSubMatchingIndex returns a slice holding the index pairs identifying the rightmost sub-match of the regular expression in b and the matches, if any, of its subexpressions, as defined by the 'SubMatch'. A return value of nil indicates no match.
func FindLastSubMatchingIndexForString ¶
FindLastSubMatchingIndexForString is like FindLastSubMatchingIndex but the source d is a string.
func FindLastSubMatchingIndexForStringWithPattern ¶
FindLastSubMatchingIndexForStringWithPattern is like FindLastSubMatchingIndexForString but instead of a regex, it takes a pattern to match the content.
func FindLastSubMatchingIndexWithPattern ¶
FindLastSubMatchingIndexWithPattern is like FindLastSubMatchingIndex but instead of a regex, it takes a pattern to match the content.
func FindLastWithPattern ¶
FindLastWithPattern is like FindLast but instead of a regex, it takes a pattern to match the content.
func FindString ¶
FindString is like Find but the source d is a string.
func FindStringWithPattern ¶
FindStringWithPattern is like FindString but instead of a regex, it takes a pattern to match the content.
func FindSubMatches ¶
FindSubMatches returns a slice of slices holding the text of the n number of sub-matches of the regular expression in d and the matches, if any, of its subexpressions, as defined by the 'SubMatch' descriptions in the package comment. A return value of nil indicates no match.
func FindSubMatchesForString ¶
FindSubMatchesForString is like FindSubMatches but the source d is a string.
func FindSubMatchesForStringWithPattern ¶
FindSubMatchesForStringWithPattern is like FindSubMatchesForString but instead of a regex, it takes a pattern to match the content.
func FindSubMatchesWithPattern ¶
FindSubMatchesWithPattern is like FindSubMatches but instead of a regex, it takes a pattern to match the content.
func FindSubMatchingIndices ¶
FindSubMatchingIndices returns a slice of slices holding the index pairs identifying the n number of sub-matches of the regular expression in d and the matches, if any, of its subexpressions, as defined by the 'SubMatch' descriptions in the package comment. A return value of nil indicates no match.
func FindSubMatchingIndicesForString ¶
FindSubMatchingIndicesForString is like FindSubMatchingIndices but the source d is a string.
func FindSubMatchingIndicesForStringWithPattern ¶
func FindSubMatchingIndicesForStringWithPattern(d string, pattern string, n int) [][]*pair.Pair[int, int]
FindSubMatchingIndicesForStringWithPattern is like FindSubMatchingIndicesForString but instead of a regex, it takes a pattern to match the content.
func FindSubMatchingIndicesWithPattern ¶
FindSubMatchingIndicesWithPattern is like FindSubMatchingIndices but instead of a regex, it takes a pattern to match the content.
func FindWithPattern ¶
FindWithPattern is like Find but instead of a regex, it takes a pattern to match the content.
func MatchString ¶
MatchString is like Match but the source d is a string.
func MatchStringWithPattern ¶
MatchStringWithPattern is like MatchString but instead of a regex, it takes a pattern to match the content.
func MatchWithPattern ¶
MatchWithPattern is like Match but instead of a regex, it takes a pattern to match the content.
func RemoveAllString ¶
RemoveAllString is used to remove all the matches of the regex in the given string.
func RemoveAllStringWithPattern ¶
RemoveAllStringWithPattern is used to remove all the matches of the pattern in the given string.
func RemoveAllWithPattern ¶
RemoveAllWithPattern is used to remove all the matches of the pattern in the given data.
func ReplaceAll ¶
ReplaceAll is used to replace all the matches of the regex in the given data with the replacement. Inside replacement, $ signs are interpreted as in Expand, so for instance $1 represents the text of the first sub-match.
func ReplaceAllString ¶
ReplaceAllString is used to replace all the matches of the regex in the given string with the replacement. Inside replacement, $ signs are interpreted as in Expand, so for instance $1 represents the text of the first sub-match.
func ReplaceAllStringWithPattern ¶
ReplaceAllStringWithPattern is used to replace all the matches of the pattern in the given string with the replacement. Inside replacement, $ signs are interpreted as in Expand, so for instance $1 represents the text of the first sub-match.
func ReplaceAllWithPattern ¶
ReplaceAllWithPattern is used to replace all the matches of the pattern in the given data with the replacement. Inside replacement, $ signs are interpreted as in Expand, so for instance $1 represents the text of the first sub-match.
Types ¶
This section is empty.