Documentation ¶
Overview ¶
Package glob defines a globbing syntax and implements matching routines.
Globs match a slash separated series of glob expressions.
// Patterns: term ['/' term]* term: '*' matches any sequence of non-Separator characters '?' matches any single non-Separator character '[' [ '^' ] { character-range } ']' // Character classes (must be non-empty): c matches character c (c != '*', '?', '\\', '[', '/') '\\' c matches character c // Character-ranges: c matches character c (c != '\\', '-', ']') '\\' c matches character c lo '-' hi matches character c for lo <= c <= hi
This package is DEPRECATED. Use v.io/v23/glob instead.
Index ¶
- type Glob
- func (g *Glob) Finished() bool
- func (g *Glob) MatchInitialSegment(segment string) (matched bool, exact bool, remainder *Glob)
- func (g *Glob) PartialMatch(start int, elems []string) (matched bool, exact bool, remainder *Glob)
- func (g *Glob) Split(start int) *Glob
- func (g *Glob) SplitFixedElements() ([]string, *Glob)
- func (g *Glob) SplitFixedPrefix() ([]string, *Glob)
- func (g *Glob) Tail() *Glob
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Glob ¶
Glob represents a slash separated path glob pattern. This type is DEPRECATED. Use v.io/v23/glob.Glob instead.
func (*Glob) Finished ¶
Finished returns true if the pattern cannot match anything. This method is DEPRECATED.
func (*Glob) MatchInitialSegment ¶
MatchInitialSegment tries to match segment against the initial element of g. Returns: matched, a boolean indicating whether the match was successful; exact, a boolean indicating whether segment matched a fixed string pattern; remainder, a Glob representing the unmatched remainder of g. This method is DEPRECATED.
func (*Glob) PartialMatch ¶
PartialMatch tries matching elems against part of a glob pattern. Returns: matched, a boolean indicating whether each element e_i of elems matches the (start + i)th element of the glob pattern; exact, a boolean indicating whether elems matched a fixed string pattern. <path> is considered an exact match for pattern <path>/...; remainder, a Glob representing the unmatched remainder of g. remainder will be empty if the pattern is completely matched.
Note that if the glob is recursive elems can have more elements then the glob pattern and still get a true result. This method is DEPRECATED.
func (*Glob) Split ¶
Split returns the suffix of g starting at the path element corresponding to start. This method is DEPRECATED.
func (*Glob) SplitFixedElements ¶
SplitFixedElements returns the part of the glob pattern that contains only fixed elements, and the glob that follows it. This method is DEPRECATED.
func (*Glob) SplitFixedPrefix ¶
SplitFixedPrefix returns the part of the glob pattern that contains only fixed elements, and the glob that follows it. This method is DEPRECATED.