Import std.text.glob
std.text.glob
Matching text against a shell's wildcard patterns.
- is any run of characters but /, and ** any run at all, so "src//*.fb" reaches into folders,
and "/", as a whole folder, can be no folder, as in bash's globstar; ? is one character but /;
[abc]and[a-z]are one of a set, and[!abc]or[^abc]one that isn't, never /; {a,b} is either; and \ makes the character after it itself. A [ or { without its end is itself.
std/text/glob.fb
Types
Glob
class
Public Class Glob
A pattern, read once, which Matches tells text against.
Examples
Expect(Glob.Match("*.txt", "notes.txt"))
Expect(!Glob.Match("*.txt", "notes.md"))
Local images = Glob("img?.[pj]ng")
Expect(images.Matches("img1.png") && images.Matches("img2.jng") && !images.Matches("img10.png"))
Expect(Glob.Match("READ*", "readme", True))-
The pattern, as it was given.
-
Whether letters match in either case.
-
A Glob of
pattern. WithignoreCase, letters match in either case, as Unicode folds each one, so thepatternmatches all it does without it, and more. -
Whether all of
textmatches the pattern. -
Public Static Method Match(pattern: String, text: String, ignoreCase: Bool = False): Boolstatic method #Whether all of
textmatchespattern, as Glob(pattern,ignoreCase).Matches(text) tells.
Report an issue with this page or with FutureBlitz on GitHub.