[[minimatch]]を使う。 ```ts import { expect, test } from "bun:test"; import { minimatch } from "minimatch"; test.each([ ["hoge.md", "*.txt", false], ["hoge.md", "*.md", true], ["hoge.md", "ho*", true], ["hoge.md", "ha*", false], ["/a/b/hoge.md", "/*", false], ["/a/b/hoge.md", "/*/*", false], ["/a/b/hoge.md", "/*/*/*", true], ["/a/b/hoge.md", "/*/hoge.md", false], ["/a/b/hoge.md", "/**", true], ["/a/b/hoge.md", "/*/**", true], ["/a/b/hoge.md", "/*/*/**", true], ["/a/b/hoge.md", "/**/hoge.md", true], ["/abc/efg/hoge.md", "/abc/**/*.md", true], ["/abc/efg/hij/hoge.md", "/abc/**/*.md", true], ["/abc/efg/hij/hoge.md", "/efg/**/*.md", false], ["/abc/efg/hij/hoge.md", "/**/efg/**/*.md", true], ["hoge.md", "hog[ae].md", true], ["hogu.md", "hog[ae].md", false], ["hoge.md", "hoge.{md,txt}", true], ["hoge.txt", "hoge.{md,txt}", true], ["hoge.rs", "hoge.{md,txt}", false], ])( `minimatch("%s", "%s") return %o`, (text: string, pattern: string, expected: boolean) => { expect(minimatch(text, pattern)).toBe(expected); } ); ```