Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Regex ¶
type Regex interface { IsMatch(haystack string) bool MatchFirst(haystack string) (RegexMatch, bool) MatchAll(haystack string) []RegexMatch ReplaceAll(haystack string, repl string, literal bool) string ReplaceAllFunc(haystack string, repl func(string) string) string RemoveAll(haystack string) string GroupCount() int }
type RegexMatch ¶
type RegexMatch struct {
// contains filtered or unexported fields
}
func (RegexMatch) FullMatch ¶
func (m RegexMatch) FullMatch() RegexMatchGroup
func (RegexMatch) GroupByIndex ¶
func (m RegexMatch) GroupByIndex(idx int) RegexMatchGroup
GroupByIndex returns the value of a matched group (group 0 == whole match)
func (RegexMatch) GroupByName ¶
func (m RegexMatch) GroupByName(name string) RegexMatchGroup
GroupByName returns the value of a matched group (group 0 == whole match)
func (RegexMatch) GroupCount ¶
func (m RegexMatch) GroupCount() int
GroupCount returns the amount of groups in this match, does not count group-0 (whole match)
type RegexMatchGroup ¶
type RegexMatchGroup struct {
// contains filtered or unexported fields
}
func (RegexMatchGroup) End ¶
func (g RegexMatchGroup) End() int
func (RegexMatchGroup) Length ¶
func (g RegexMatchGroup) Length() int
func (RegexMatchGroup) Range ¶
func (g RegexMatchGroup) Range() (int, int)
func (RegexMatchGroup) Start ¶
func (g RegexMatchGroup) Start() int
func (RegexMatchGroup) Value ¶
func (g RegexMatchGroup) Value() string
Click to show internal directories.
Click to hide internal directories.