EReg
class ERegAvailable in flash, flash9, neko, js, phpRegular expressions are a way to find regular patterns into Strings. Have a look at the tutorial on haXe website to learn how to use them.
function new( r : String, opt : String ) : VoidCreates a new regular expression with pattern
r and options opt.
function customReplace( s : String, f : EReg -> String ) : StringFor each occurence of the pattern in the string s, the function f is called and can return the string that needs to be replaced. All occurences are matched anyway, and setting the g flag might cause some incorrect behavior on some platforms.
function match( s : String ) : BoolTells if the regular expression matches the String. Updates the internal state accordingly.
function matched( n : Int ) : StringReturns a matched group or throw an expection if there is no such group. If n = 0, the whole matched substring is returned.
function matchedLeft() : StringReturns the part of the string that was as the left of of the matched substring.
function matchedPos() : { pos : Int, len : Int }Returns the position of the matched substring within the original matched string.
function matchedRight() : StringReturns the part of the string that was as the right of of the matched substring.
function replace( s : String, by : String ) : StringReplaces a pattern by another string. The by format can contains $1 to $9 that will correspond to groups matched while replacing. $$ means the $ character.
function split( s : String ) : Array<String>Split a string by using the regular expression to match the separators.
version #2467, modified 2008-07-28 10:02:40 by api