24 #if !defined (octave_lo_regexp_h)
25 #define octave_lo_regexp_h 1
47 const std::string&
w =
"regexp")
48 : pattern (pat), options (opt), data (0), named_pats (),
49 nnames (0), named_idx (), who (
w)
55 : pattern (rx.pattern), data (rx.data), named_pats (rx.named_pats),
56 nnames (rx.nnames), named_idx (rx.named_idx)
83 match_data
match (
const std::string& buffer);
85 bool is_match (
const std::string& buffer);
89 std::string
replace (
const std::string& buffer,
90 const std::string& replacement);
97 : x_case_insensitive (false), x_dotexceptnewline (false),
98 x_emptymatch (false), x_freespacing (false), x_lineanchors (false),
102 : x_case_insensitive (o.x_case_insensitive),
103 x_dotexceptnewline (o.x_dotexceptnewline),
104 x_emptymatch (o.x_emptymatch),
105 x_freespacing (o.x_freespacing),
106 x_lineanchors (o.x_lineanchors),
132 void once (
bool val) { x_once = val; }
139 bool once (
void)
const {
return x_once; }
156 const std::string& ms,
const Matrix& te,
158 : x_match_string (ms), x_named_tokens (nt), x_tokens (t),
159 x_token_extents (te), x_start (s), x_end (e)
163 : x_match_string (a.x_match_string),
164 x_named_tokens (a.x_named_tokens), x_tokens (a.x_tokens),
165 x_token_extents (a.x_token_extents),
166 x_start (a.x_start), x_end (a.x_end)
173 double start (
void)
const {
return x_start; }
174 double end (
void)
const {
return x_end; }
200 named_pats (rx_lst.named_pats)
241 void compile_internal (
void);
246 const std::string& buffer,
248 const std::string& who =
"regexp")
250 regexp rx (pat, opt, who);
252 return rx.
match (buffer);
257 const std::string& buffer,
259 const std::string& who =
"regexp")
261 regexp rx (pat, opt, who);
270 const std::string& who =
"regexp")
272 regexp rx (pat, opt, who);
279 const std::string& buffer,
280 const std::string& replacement,
282 const std::string& who =
"regexp")
284 regexp rx (pat, opt, who);
286 return rx.
replace (buffer, replacement);
std::string match_string(void) const
regexp(const std::string &pat="", const regexp::opts &opt=regexp::opts(), const std::string &w="regexp")
void emptymatch(bool val)
bool is_regexp_match(const std::string &pat, const std::string &buffer, const regexp::opts &opt=regexp::opts(), const std::string &who="regexp")
regexp::match_data regexp_match(const std::string &pat, const std::string &buffer, const regexp::opts &opt=regexp::opts(), const std::string &who="regexp")
string_vector named_patterns(void)
void dotexceptnewline(bool val)
void freespacing(bool val)
match_element(const string_vector &nt, const string_vector &t, const std::string &ms, const Matrix &te, double s, double e)
string_vector named_tokens(void) const
bool dotexceptnewline(void) const
std::string regexp_replace(const std::string &pat, const std::string &buffer, const std::string &replacement, const regexp::opts &opt=regexp::opts(), const std::string &who="regexp")
static void replace(QString &text, const QRegExp &re, const QString &after)
std::complex< double > w(std::complex< double > z, double relerr=0)
bool freespacing(void) const
string_vector tokens(void) const
match_data(const match_data &rx_lst)
match_data(const std::list< match_element > &l, const string_vector &np)
bool emptymatch(void) const
bool case_insensitive(void) const
string_vector x_named_tokens
octave_base_list & operator=(const octave_base_list &bl)
bool lineanchors(void) const
std::string replace(const std::string &buffer, const std::string &replacement)
void case_insensitive(bool val)
match_data match(const std::string &buffer)
Matrix token_extents(void) const
void lineanchors(bool val)
void compile(const std::string &pat, const regexp::opts &opt=regexp::opts())
std::string x_match_string
static bool match(const std::string &filename_arg, const std::string &path_elt_arg)
match_element(const match_element &a)
bool is_match(const std::string &buffer)