#include <sprockit/spkt_config.h>
#include <string>
#include <vector>
Go to the source code of this file.
|
double | get_regexp_double (const std::string ®exp, const std::string &text, int flags=0) |
| Extracts a double precision number from text. More...
|
|
std::string | get_regexp_string (const std::string ®exp, const std::string &text, int flags=0) |
| Extracts a string from text. More...
|
|
double * | get_regexp_double_array (const std::string ®exp, 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 ®exp, 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 ®exp, const std::string &text, int flags=0) |
| Tests a string to see if it contains a certain RegEx. More...
|
|
Enumerator |
---|
IgnoreCase |
|
UpperCase |
|
FindAll |
|
LowerCase |
|
IncludeLineBreaks |
|
StripWhitespace |
|
Definition at line 10 of file regexp.h.
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
-
matches | The vector of strings to hold the results. |
regexp | The regular expression containing the (captured) strings. |
text | The text to apply the RegEx to. |
flags | An 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
-
regexp | The regular expression containing the (captured) number. |
text | The text to apply the RegEx to. |
flags | An 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
-
regexp | The regular expression containing the (captured) values. |
text | The text to apply the RegEx to. |
flags | An 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 |
|
) |
| |
std::string get_regexp_string |
( |
const std::string & |
regexp, |
|
|
const std::string & |
text, |
|
|
int |
flags = 0 |
|
) |
| |
Extracts a string from text.
- Parameters
-
regexp | The regular expression containing the (captured) string. |
text | The text to apply the RegEx to. |
flags | An 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
-
regexp | The regular expression to test. |
text | The text to apply the RegEx to. |
flags | An 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 |