Skip to content

Go package helping to do ease pattern matching on strings.

License

Notifications You must be signed in to change notification settings

tideland/go-matcher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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