Documentation
¶
Index ¶
- Variables
- type File
- type RxElement
- func Alternation(elts ...RxElement) RxElement
- func Anchor(elts ...RxElement) RxElement
- func Any(elts ...RxElement) RxElement
- func Capture(name string, elt RxElement) RxElement
- func Element(v interface{}) RxElement
- func Group(elt RxElement) RxElement
- func Join(glue string, elts []RxElement) RxElement
- func Literal(str string) RxElement
- func Mod(elt RxElement, modifier string) RxElement
- func Optional(elts ...RxElement) RxElement
- func Sequence(elts ...RxElement) RxElement
- func Some(elts ...RxElement) RxElement
- func TrimAnchor(elts ...RxElement) RxElement
- type Variable
Constants ¶
This section is empty.
Variables ¶
View Source
var ( HexDigit = RxElement(`[0-9a-f]`) HexNumber = Some(HexDigit) DecimalDigit = RxElement(`\d`) DecimalNumber = Some(DecimalDigit) WordChar = RxElement(`\w`) Word = Some(WordChar) Base64Char = RxElement(`[./a-zA-Z0-9_-]`) Base64 = Sequence(Some(Base64Char), Any(`=`)) Beginning = RxElement(`^`) End = RxElement(`$`) AnyWhitespace = RxElement(`\s*`) )
Just some elements, this should be more complete
Functions ¶
This section is empty.
Types ¶
type RxElement ¶
type RxElement string
A regexp sub-expression
func Join ¶
Wrap all elts in capturing groups, join with glue (only "|" or "" seem to make much sense), wrap whole thing with another non-capturing group
func TrimAnchor ¶
Return a sequence, anchored at the beginning and end, trimming (i.e. matching and not capturing) leading and trailing whitespace
type Variable ¶
A variable is a named regexp. It is translated to a `*regexp.Regexp` variable and constants enumerating named captures.
func MustVariable ¶
Returns new variable object, panics on error
func NewVariable ¶
Returns new variable object or error
Click to show internal directories.
Click to hide internal directories.