3 /* C++ wrapper around the POSIX regex functions:
4 regcomp, regexec, regerror, regfree.
24 LRegex(string const & regex);
30 typedef pair<string::size_type, string::size_type> MatchPair;
33 typedef vector<MatchPair> SubMatches;
35 /// Returns all the matches in a vector
36 SubMatches const & exec(string const & str) const;
38 /// The whole of str matches regex.
39 bool exact_match(string const & str) const;
42 MatchPair first_match(string const & str) const;
45 string getError() const;
48 int getErrorCode() const;
50 /// Will the next operation fail of not.
61 // We comment out these, we can comment them in when we need them.
63 // some built in regular expressions
65 extern const LRegex LRXwhite; // = "[ \n\t\r\v\f]+"
66 extern const LRegex LRXint; // = "-?[0-9]+"
67 extern const LRegex LRXdouble; // = "-?\\(\\([0-9]+\\.[0-9]*\\)\\|
68 // \\([0-9]+\\)\\|\\(\\.[0-9]+\\)\\)
69 // \\([eE][---+]?[0-9]+\\)?"
70 //extern const LRegex LRXalpha; // = "[A-Za-z]+"
71 //extern const LRegex LRXlowercase; // = "[a-z]+"
72 //extern const LRegex LRXuppercase; // = "[A-Z]+"
73 //extern const LRegex LRXalphanum; // = "[0-9A-Za-z]+"
74 extern const LRegex LRXidentifier; // = "[A-Za-z_][A-Za-z0-9_]*"