W3cubDocs

/Haxe

Rex

package lua.lib.lrexlib

Available on lua

Methods

exec (subj:String, ?init:Int, ?ef:Int):Dynamic

This function searches for the first match of the regexp in the string subj, starting from offset init, subject to execution flags ef.

tfind (subj:String, ?init:Int, ?ef:Int):Dynamic

The function searches for the first match of the regexp in the string subj, starting from offset init, subject to execution flags ef.

Static methods

static count (subj:String, patt:String, cf:Int, ef:Int):Dynamic

This function counts matches of the pattern patt in the string subj.

static inline create (expr:String, flag:String):Rex

static inline create (expr:String, flag:Int):Rex

static find (subj:String, ?init:Int, ?ef:Int):Dynamic

The function searches for the first match of the regexp patt in the string subj, starting from offset init, subject to flags cf and ef.

static flags (?tb:Dynamic):Dynamic

static gmatch (subj:String, patt:String, ?cf:Int, ?ef:Int):Void ‑> String

The function is intended for use in the generic for Lua construct. It returns an iterator for repeated matching of the pattern patt in the string subj, subject to flags cf and ef.

static gsub (subj:String, patt:String, repl:Dynamic, ?n:Int, ?cf:Int, ?ef:Int):String

static gsub (subj:String, patt:Rex, repl:Dynamic, ?n:Int, ?cf:Int, ?ef:Int):String

This function searches for all matches of the pattern patt in the string subj and replaces them according to the parameters repl and n.

static match (patt:String, ?init:Int, ?ef:Int):Dynamic

The function searches for the first match of the regexp patt in the string subj, starting from offset init, subject to flags cf and ef.

Returns:

matched string, or array of strings.

static split (subj:String, sep:String, ?cf:Int, ?ef:Int):Void ‑> String

static split (subj:String, sep:Rex, ?cf:Int, ?ef:Int):Void ‑> String

The function is intended for use in the generic for Lua construct. It is used for splitting a subject string subj into parts (sections). The sep parameter is a regular expression pattern representing separators between the sections.

© 2005–2016 Haxe Foundation
Licensed under a MIT license.
http://api.haxe.org/lua/lib/lrexlib/Rex.html