Skip to content

Gorillarock/justincase

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

JustInCase

a toolset for easy regex generation.

Functions:

GenerateCaseInsensitiveRegex

  • takes string input param
  • returns *regexp.Regexp (which matches on input word regardless of casing of any letters)

Example Usage:


package main

import (
	"fmt"

	justincase "github.com/Gorillarock/justincase"
)

func main() {
	reg := justincase.GenerateCaseInsensitiveRegex("pEopLe")
	fmt.Printf("people == %s (%v)\n", reg, reg.MatchString("people"))
	fmt.Printf("PEOPLE == %s (%v)\n", reg, reg.MatchString("PEOPLE"))
	fmt.Printf("PeOPLe == %s (%v)\n", reg, reg.MatchString("PeOPLe"))
	fmt.Printf("POPLE == %s (%v)\n", reg, reg.MatchString("POPLE"))
}

About

Helpful regex tool for Golang

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages