Documentation ¶
Index ¶
- Variables
- func Anchored(res ...*regexp.Regexp) *regexp.Regexp
- func Capture(res ...*regexp.Regexp) *regexp.Regexp
- func CharSet(s string) *regexp.Regexp
- func Group(res ...*regexp.Regexp) *regexp.Regexp
- func Literal(s string) *regexp.Regexp
- func Optional(res ...*regexp.Regexp) *regexp.Regexp
- func OptionalRepeated(res ...*regexp.Regexp) *regexp.Regexp
- func Or(res ...*regexp.Regexp) *regexp.Regexp
- func Repeated(res ...*regexp.Regexp) *regexp.Regexp
- func Repetition(min, max int, res ...*regexp.Regexp) *regexp.Regexp
- func Sequence(res ...*regexp.Regexp) *regexp.Regexp
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Alpha defines the alpha atom. // This only allows upper and lower case characters. Alpha = Match(`[A-Za-z]+`) // Numeric defines the alpha atom. // This only allows a non-empty sequence of digits. Numeric = Match(`[0-9]+`) // AlphaNumeric defines the alpha numeric atom, typically a // component of names. This only allows upper and lower case characters and digits. AlphaNumeric = Match(`[A-Za-z0-9]+`) // Identifier is an AlphaNumeric regexp starting with an Alpha regexp. Identifier = Sequence(Alpha, Match(`[A-Za-z0-9]`), Optional(Literal("+"), Alpha)) )
View Source
var Match = regexp.MustCompile
Match compiles the string to a regular expression.
Functions ¶
func Literal ¶
Literal compiles s into a literal regular expression, escaping any regexp reserved characters.
func Optional ¶
Optional wraps the expression in a non-capturing group and makes the production optional.
func OptionalRepeated ¶
OptionalRepeated wraps the regexp in a non-capturing group to get any number of matches.
func Repetition ¶
Repetition wraps the regexp in a non-capturing group to get a range of matches.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.