regexbuilder

package
v0.0.0-...-68fadb2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 2, 2024 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Alternations, adds a set of patterns to match. ie `(?:alts0|alts1,altsn...)`

func (PatternBuilder) B

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

Append to the pattern the literal string, (this escapes/quotes the string)

func (PatternBuilder) QQ

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL