Regex Package

Regex Package

Regular expression capabilities provided by the Regex package.


isMatch = Regex.matches("\d+", "123");
    
MethodDescription
Regex.match(pattern, text)Returns a Match struct or null.
Regex.matches(pattern, text)Returns true/false if entire text matches.
Regex.findAll(pattern, text)Returns array of Match structs.
Regex.replace(pattern, text, repl)Replace all matches.
Regex.split(pattern, text)Split text by pattern.

Match Structure

The Match struct returned by match and findAll contains: