Skip to content
FutureBlitz

    Install

    Import std.text.glob

    Glob

    std.text.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))

    std/text/glob.fb, line 39

    • Public ReadOnly Field Pattern: String field #

      The pattern, as it was given.

    • Public ReadOnly Field IgnoreCase: Bool field #

      Whether letters match in either case.

    • Public New(pattern: String, ignoreCase: Bool = False) constructor #

      A Glob of pattern. With ignoreCase, letters match in either case, as Unicode folds each one, so the pattern matches all it does without it, and more.

    • Public Method Matches(text: String): Bool method #

      Whether all of text matches the pattern.

    • Public Static Method Match(pattern: String, text: String, ignoreCase: Bool = False): Bool static method #

      Whether all of text matches pattern, as Glob(pattern, ignoreCase).Matches(text) tells.

    Report an issue with this page or with FutureBlitz on GitHub.