Documentation
¶
Overview ¶
Package regexp provides regular expression operations for the operation graph.
Index ¶
- type Provider
- func (p *Provider) Find(pattern, s string) (string, error)
- func (p *Provider) FindAll(pattern, s string, count int) ([]string, error)
- func (p *Provider) FindAllSubmatch(pattern, s string, count int) ([][]string, error)
- func (p *Provider) FindSubmatch(pattern, s string) ([]string, error)
- func (p *Provider) Match(pattern, s string) (bool, error)
- func (p *Provider) Replace(pattern, s, replacement string) (string, error)
- func (p *Provider) ReplaceLiteral(pattern, s, replacement string) (string, error)
- func (p *Provider) Split(pattern, s string, count int) ([]string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Provider ¶
type Provider struct {
op.ProviderBase
// contains filtered or unexported fields
}
Provider provides regular expression operations with compiled pattern caching.
+devlore:access=immediate
func (*Provider) Find ¶
Find returns the first match of the pattern in the string. Returns an empty string if no match is found.
func (*Provider) FindAll ¶
FindAll returns all non-overlapping matches of the pattern. The count parameter limits the number of matches; -1 means no limit.
func (*Provider) FindAllSubmatch ¶
FindAllSubmatch returns all matches with their submatches. The count parameter limits the number of matches; -1 means no limit.
func (*Provider) FindSubmatch ¶
FindSubmatch returns the first match and its submatches. Returns nil if no match is found.
func (*Provider) Replace ¶
Replace replaces all matches of the pattern with the replacement string. The replacement can include $1, $2, etc. for submatch references.
func (*Provider) ReplaceLiteral ¶
ReplaceLiteral replaces all matches with the literal replacement string (no submatch expansion).