Skip to content

tmikus/onig-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Oniguruma Go

Go bindings for the Oniguruma regex library, a powerful and mature regular expression library with support for a wide range of character sets and language syntaxes. Oniguruma is written in C.

Dual-licensed under MIT or the UNLICENSE.

Installation

Prerequisites:

In order to install onig-go, you need to have the Oniguruma library installed on your system.

You can install it using Homebrew:

brew install oniguruma

Or on Ubuntu you can install it using apt:

sudo apt install libonig-dev libonig5

Installation:

To install onig-go, use the following command:

go get github.com/tmikus/onig-go

Example Usage

package main

import (
    "fmt"
    "github.com/tmikus/onig-go"
)

func main() {
    regex, _ := onig.NewRegex("e(l+)")
    captures, _ := regex.Captures("hello")
    for text := range captures.All() {
        fmt.Println(text)
    }
}

For more examples, see the regex_test.go file.

Documentation

The API documentation is available at https://pkg.go.dev/github.com/tmikus/onig-go.

About

No description, website, or topics provided.

Resources

License

MIT, Unlicense licenses found

Licenses found

MIT
LICENSE
Unlicense
UNLICENSE

Stars

Watchers

Forks

Packages

No packages published