Documentation ¶
Overview ¶
Package regexputil implements some introspection on parsed regexps.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Regexp ¶
type Regexp struct {
// contains filtered or unexported fields
}
Regexp represents a parsed regexp. Use Parse to make one.
func Parse ¶
Parse takes a regexp in Perl syntax (as implemented by regexp/syntax) and returns a Regexp, for introspecting the regexp.
func (Regexp) List ¶
List returns a list of fixed matches if the regexp only matches a fixed set of alternate strings.
func (Regexp) Wildcard ¶
Wildcard attempts to convert the regexp into a wildcard form, that is, if it can be represented as a glob pattern using only "*", it will return "string*" and true. It is assumed the "*" glob character matches 0 or more characters only (i.e. is exactly identical to ".*"). Literal strings (i.e. not containing any "*") will also be returned, if you need to handle these differently it is recommended to call List first.