You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Adrien Kara 095902fa93
Fix typo ...
6 months ago
.gitignore Initial commit 7 months ago
LICENSE Initial commit 7 months ago Fix typo ... 6 months ago
go.mod Fix typo ... 6 months ago
wildcard.go Fork from minio pkg 7 months ago
wildcard_test.go Fix typo ... 6 months ago


Go Report Card Go Reference Go coverage Apache V2 License

Go-wildcard is forked from Minio project


This part of Minio project is a very cool, fast and light wildcard pattern matching.
But using it, need to import the full Minio project inside your own ... And this is a cool, but BIG project.

Two function are available MatchSimple and Match

  • MatchSimple only covert * usage (he is a bit faster)
  • Match support full wildcard matching, * and ?

I know Regex, but this is a big part, and it is slow (even prepared regex) ...
I know Glob, but most of the time, I only need simple wildcard matching.

How to

For using GitHub repo

go mod edit -replace
go get

From selfhosted (I can't warranty the availability)

go get

Quick Example

This example shows a Go file which pattern matching ...
You can use the Github repos to

package main

import (

	wildcard ""

func main() {
    str := "daaadabadmanda"
    pattern := "da*da*da*"
    result := wildcard.MatchSimple(pattern, str)
	fmt.Println(str, pattern, result)

    pattern = "?a*da*d?*"
    result = wildcard.Match(pattern, str)
	fmt.Println(str, pattern, result)