Skip to content

Repository files navigation

gonigmo is a Go wrapper for the Onigmo regex engine

Based on github.com/moovweb/rubex by Zhigang Chen

Installation

Install Onigmo:

git clone https://github.com/k-takata/Onigmo.git --depth=1
cd Onigmo
./configure && make && sudo make install

Install or update gonigmo:

go get -u -f github.com/ungerik/gonigmo

You may have to disable cgocheck to prevent false positives:

GODEBUG=cgocheck=0

Example Usage

import"github.com/ungerik/gonigmo"rxp:=gonigmo.MustCompile("[a-z]*")
iferr!=nil {
// whoops
}
result:=rxp.FindString("a me my")
ifresult!="" {
// FOUND A STRING!! YAY! Must be "a" in this instance
} else {
// no good
}

About

Go wrapper for the Onigmo (Oniguruma-mod) regex engine

Resources

Stars

1 star

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages