gluare

package module
v0.0.0-...-d7c94f1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 7, 2017 License: MIT Imports: 3 Imported by: 2 modules, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

===============================================================================
gluare: Regular expressions for the GopherLua
===============================================================================

.. image:: https://travis-ci.org/yuin/gluare.svg
    :target: https://travis-ci.org/yuin/gluare

|

gluare is a regular expression library for the `GopherLua <https://github.com/yuin/gopher-lua>`_ .
gluare has almost the same API as Lua pattern match.

.. contents::
   :depth: 1

----------------------------------------------------------------
Installation
----------------------------------------------------------------

.. code-block:: bash
   
   go get github.com/yuin/gluare

----------------------------------------------------------------
Usage
----------------------------------------------------------------

.. code-block:: go

   import (
       "github.com/yuin/gopher-lua"
       "github.com/yuin/gluare"
   )
   
   L := lua.NewState()
   defer L.Close()
   L.PreloadModule("re", gluare.Loader)

----------------------------------------------------------------
Lua functions
----------------------------------------------------------------

`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.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Loader

func Loader(L *lua.LState) int

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址