Skip to content

helmbold/richgo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Rich Go

Rich Go is a library to enrich the Go (golang) standard library.

For now it contains only a more comfortable to use version of regexp.

Usage:

import "github.com/helmbold/richgo/regexp"

func main() {
  regex := MustCompile(`/(?P<country>[^/]+)/(?P<city>[^/]+)`)
  match := regex.Match("/Germany/Dresden")

  // accessing capturing group by name
  fmt.Println("country: ", match.NamedGroups["country"])

  // accessing capturing group by index
  fmt.Println("city: ", match.Groups[2])
}

About

RichGo is a library to enrich the Go standard library.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages