Table of Contents

Regex Namespace

The regex namespace contains functions that expose C++ regex functionality to Lua. Due to Lua's limited regular expression functions, users may need some better regex support from C++ which this namespace provides.

You can access these functions via:

ashita.regex.


ashita.regex.match

Matches a given pattern. (Calls std::regex_match)

table ashita.regex.match(message, pattern);


ashita.regex.search

Searches for a given pattern. (Calls std::regex_search)

table ashita.regex.match(message, pattern);


ashita.regex.replace

Replaces matches found within a message.. (Calls std::regex_replace)

string ashita.regex.replace(message, pattern, rep);


ashita.regex.split

Splits a string based on a pattern. (Calls std::sregex_token_iterator)

table ashita.regex.replace(message, pattern, rep);