Documentation ¶
Index ¶
- Variables
- type PatternBuilder
- func (b PatternBuilder) A(alts ...PatternBuilder) PatternBuilder
- func (b PatternBuilder) B(source PatternBuilder) PatternBuilder
- func (b PatternBuilder) Compile() *regexp.Regexp
- func (b PatternBuilder) DebugCheck() PatternBuilder
- func (b PatternBuilder) G(idxBind *int, pattern PatternBuilder) PatternBuilder
- func (b PatternBuilder) GG(idxBind *int, pattern string) PatternBuilder
- func (b PatternBuilder) Q(s string) PatternBuilder
- func (b PatternBuilder) QQ(s []byte) PatternBuilder
- func (b PatternBuilder) R(rawPattern string) PatternBuilder
Constants ¶
This section is empty.
Variables ¶
View Source
var B = PatternBuilder{}
TODO: Calling code can mutate this, probably should have a function return constructor instead
Functions ¶
This section is empty.
Types ¶
type PatternBuilder ¶
type PatternBuilder struct {
// contains filtered or unexported fields
}
func (PatternBuilder) A ¶
func (b PatternBuilder) A(alts ...PatternBuilder) PatternBuilder
Alternations, adds a set of patterns to match. ie `(?:alts0|alts1,altsn...)`
func (PatternBuilder) B ¶
func (b PatternBuilder) B(source PatternBuilder) PatternBuilder
Appends annother builder to this one
func (PatternBuilder) Compile ¶
func (b PatternBuilder) Compile() *regexp.Regexp
Compiles, and initializes the group IDXs. Panics on bad regex...
func (PatternBuilder) DebugCheck ¶
func (b PatternBuilder) DebugCheck() PatternBuilder
panics if the current pattern doesn't compile
func (PatternBuilder) G ¶
func (b PatternBuilder) G(idxBind *int, pattern PatternBuilder) PatternBuilder
Adds a group, idxBind is set to the group index on Compile
func (PatternBuilder) GG ¶
func (b PatternBuilder) GG(idxBind *int, pattern string) PatternBuilder
Like G, but you can supply a pattern string instead of a struct
func (PatternBuilder) Q ¶
func (b PatternBuilder) Q(s string) PatternBuilder
Append to the pattern the literal string, (this escapes/quotes the string)
func (PatternBuilder) QQ ¶
func (b PatternBuilder) QQ(s []byte) PatternBuilder
Append to the pattern the literal string, (this escapes/quotes the []byte)
func (PatternBuilder) R ¶
func (b PatternBuilder) R(rawPattern string) PatternBuilder
Appends raw regex pattern
Click to show internal directories.
Click to hide internal directories.