tideland / go-matcher

Go package helping to do ease pattern matching on strings.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Tideland Go Matcher

GitHub release GitHub license Go Module GoDoc Workflow Go Report Card

Description

The Tideland Go Matcher provides a simple pattern matching. It matches the following pattterns:

  • ? matches one char
  • * matches a group of chars
  • [abc] matches any of the chars inside the brackets
  • [a-z] matches any of the chars of the range
  • [^abc] matches any but the chars inside the brackets
  • \ escapes any of the pattern chars

Examples

if matcher.Matches("g*e g?", "Google Go", matcher.IgnoreCase) { ... }

if matcher.Matches("[oO][kK]", "ok", matcher.ValidateCase) { .... }

Contributors

About

Go package helping to do ease pattern matching on strings.

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:Go 100.0%