Skip to content
forked from yuin/gluare

A regular expression library for the GopherLua

Notifications You must be signed in to change notification settings

bitwalker/gluare

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gluare: Regular expressions for the GopherLua


gluare is a regular expression library for the GopherLua . gluare has almost the same API as Lua pattern match.

go get github.com/yuin/gluare
import (
    "github.com/yuin/gopher-lua"
    "github.com/yuin/gluare"
)

L := lua.NewState()
defer L.Close()
L.PreloadModule("re", gluare.Loader)

re.find , re.gsub, re.match, re.gmatch are available. These functions have the same API as Lua pattern match. gluare uses the Go regexp package, so you can use regular expressions that are supported in the Go regexp package.

In addition, the following functions are defined:

gluare.quote(s string) -> string

Arguments:

s string a string value to escape meta characters

Returns:

string escaped string

gluare.quote returns a string that quotes all regular expression metacharacters inside the given text.

About

A regular expression library for the GopherLua

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 77.9%
  • Lua 22.1%