ARC SDK
|
A regular expression class. More...
#include <arc/ArcRegex.h>
Public Member Functions | |
RegularExpression () | |
Default constructor. | |
RegularExpression (std::string pattern) | |
Creates a regex from a pattern string. | |
RegularExpression (const RegularExpression ®ex) | |
Copy constructor. | |
~RegularExpression () | |
Destructor. | |
RegularExpression & | operator= (const RegularExpression ®ex) |
Assignment operator. | |
bool | isOk () |
Returns true if the pattern of this regex is ok. | |
bool | hasPattern (std::string str) |
Returns true if this regex has the pattern provided. | |
bool | match (const std::string &str) const |
Returns true if this regex matches whole string provided. | |
bool | match (const std::string &str, std::list< std::string > &unmatched, std::list< std::string > &matched) const |
Returns true if this regex matches the string provided. More... | |
std::string | getPattern () const |
Returns pattern. | |
A regular expression class.
This class is a wrapper around the functions provided in regex.h.
bool Arc::RegularExpression::match | ( | const std::string & | str, |
std::list< std::string > & | unmatched, | ||
std::list< std::string > & | matched | ||
) | const |
Returns true if this regex matches the string provided.
Unmatched parts of the string are stored in 'unmatched'. Matched parts of the string are stored in 'matched'. The first entry in matched is the string that matched the regex, and the following entries are parenthesised elements of the regex.