SST/macro
Enumerations | Functions
regexp.h File Reference
#include <sprockit/spkt_config.h>
#include <string>
#include <vector>
Include dependency graph for regexp.h:

Go to the source code of this file.

Enumerations

enum  RegexpFlags {
  IgnoreCase =1, UpperCase =2, FindAll =4, LowerCase =8,
  IncludeLineBreaks =16, StripWhitespace =32
}
 

Functions

double get_regexp_double (const std::string &regexp, const std::string &text, int flags=0)
 Extracts a double precision number from text. More...
 
std::string get_regexp_string (const std::string &regexp, const std::string &text, int flags=0)
 Extracts a string from text. More...
 
double * get_regexp_double_array (const std::string &regexp, const std::string &text, size_t &length, int flags=0)
 Extracts an array of doubles from text, according to a given RegEx. More...
 
void findmatch (std::vector< std::string > &matches, const std::string &regexp, const std::string &text, int flags=0)
 Extracts strings from text, according to a given RegEx. More...
 
bool get_regexp_integer (const std::string &string, int &ret)
 
bool is_regexp_integer (const std::string &str)
 
bool has_regexp_match (const std::string &regexp, const std::string &text, int flags=0)
 Tests a string to see if it contains a certain RegEx. More...
 

Enumeration Type Documentation

Enumerator
IgnoreCase 
UpperCase 
FindAll 
LowerCase 
IncludeLineBreaks 
StripWhitespace 

Definition at line 10 of file regexp.h.

Function Documentation

void findmatch ( std::vector< std::string > &  matches,
const std::string &  regexp,
const std::string &  text,
int  flags = 0 
)

Extracts strings from text, according to a given RegEx.

Parameters
matchesThe vector of strings to hold the results.
regexpThe regular expression containing the (captured) strings.
textThe text to apply the RegEx to.
flagsAn integer comprising bitwise options (see the PyFlags enum).
double get_regexp_double ( const std::string &  regexp,
const std::string &  text,
int  flags = 0 
)

Extracts a double precision number from text.

Parameters
regexpThe regular expression containing the (captured) number.
textThe text to apply the RegEx to.
flagsAn integer comprising bitwise options (see the PyFlags enum).
Returns
The value as a double.
double* get_regexp_double_array ( const std::string &  regexp,
const std::string &  text,
size_t &  length,
int  flags = 0 
)

Extracts an array of doubles from text, according to a given RegEx.

Memory is allocated by the function and ownership is passed to calling routine.

Parameters
regexpThe regular expression containing the (captured) values.
textThe text to apply the RegEx to.
flagsAn integer comprising bitwise options (see the PyFlags enum).
Returns
an array of all captured values.
bool get_regexp_integer ( const std::string &  string,
int &  ret 
)

Referenced by is_regexp_integer().

std::string get_regexp_string ( const std::string &  regexp,
const std::string &  text,
int  flags = 0 
)

Extracts a string from text.

Parameters
regexpThe regular expression containing the (captured) string.
textThe text to apply the RegEx to.
flagsAn integer comprising bitwise options (see the PyFlags enum).
Returns
The string.
bool has_regexp_match ( const std::string &  regexp,
const std::string &  text,
int  flags = 0 
)

Tests a string to see if it contains a certain RegEx.

Parameters
regexpThe regular expression to test.
textThe text to apply the RegEx to.
flagsAn integer comprising bitwise options (see the PyFlags enum).
Returns
whether the text contains a match.

Referenced by is_regexp_integer().

bool is_regexp_integer ( const std::string &  str)
inline

Definition at line 64 of file regexp.h.

References get_regexp_integer(), and has_regexp_match().

Here is the call graph for this function: