24 #if ! defined (octave_lo_regexp_h) 25 #define octave_lo_regexp_h 1 27 #include "octave-config.h" 53 nnames (0), named_idx (), who (
w)
59 :
pattern (rx.
pattern), data (rx.data), named_pats (rx.named_pats),
60 nnames (rx.nnames), named_idx (rx.named_idx)
101 regexp rx (pat, opt, who);
103 return rx.
match (buffer);
111 regexp rx (pat, opt, who);
121 regexp rx (pat, opt, who);
132 regexp rx (pat, opt, who);
134 return rx.
replace (buffer, replacement);
142 : x_case_insensitive (
false), x_dotexceptnewline (
false),
147 : x_case_insensitive (o.x_case_insensitive),
148 x_dotexceptnewline (o.x_dotexceptnewline),
149 x_emptymatch (o.x_emptymatch),
150 x_freespacing (o.x_freespacing),
151 x_lineanchors (o.x_lineanchors),
170 ~
opts (
void) =
default;
184 bool once (
void)
const {
return x_once; }
203 : x_match_string (ms), x_named_tokens (nt), x_tokens (
t),
204 x_token_extents (te), x_start (
s), x_end (
e)
208 : x_match_string (
a.x_match_string),
209 x_named_tokens (
a.x_named_tokens), x_tokens (
a.x_tokens),
210 x_token_extents (
a.x_token_extents),
211 x_start (
a.x_start), x_end (
a.x_end)
218 double start (
void)
const {
return x_start; }
219 double end (
void)
const {
return x_end; }
245 named_pats (rx_lst.named_pats)
286 void compile_internal (
void);
290 #if defined (OCTAVE_USE_DEPRECATED_FUNCTIONS) 292 OCTAVE_DEPRECATED (4.2,
"use 'octave::regexp' instead")
293 typedef
octave::regexp regexp;
295 OCTAVE_DEPRECATED (4.2, "use '
octave::regexp::match'
instead")
296 inline regexp::match_data
297 regexp_match (const
std::
string& pat,
298 const
std::
string& buffer,
299 const regexp::opts& opt = regexp::opts (),
300 const
std::
string& who = "regexp")
305 OCTAVE_DEPRECATED (4.2,
"use 'octave::regexp::is_match' instead")
307 is_regexp_match (const
std::
string& pat,
308 const
std::
string& buffer,
309 const regexp::opts& opt = regexp::opts (),
310 const
std::
string& who = "regexp")
315 OCTAVE_DEPRECATED (4.2,
"use 'octave::regexp::is_match' instead")
317 is_regexp_match (const
std::
string& pat,
319 const regexp::opts& opt = regexp::opts (),
320 const
std::
string& who = "regexp")
325 OCTAVE_DEPRECATED (4.2,
"use 'octave::regexp::replace' instead")
327 regexp_replace (const
std::
string& pat,
328 const
std::
string& buffer,
329 const
std::
string& replacement,
330 const regexp::opts& opt = regexp::opts (),
331 const
std::
string& who = "regexp")
match_data(const std::list< match_element > &l, const string_vector &np)
match_element(const string_vector &nt, const string_vector &t, const std::string &ms, const Matrix &te, double s, double e)
Matrix token_extents(void) const
identity matrix If supplied two scalar respectively For allows like xample val
bool case_insensitive(void) const
static regexp::match_data match(const std::string &pat, const std::string &buffer, const regexp::opts &opt=regexp::opts(), const std::string &who="regexp")
OCTAVE_EXPORT octave_value_list return the number of command line arguments passed to Octave If called with the optional argument the function t
bool freespacing(void) const
calling an anonymous function involves an overhead quite comparable to the overhead of an m file function Passing a handle to a built in function is because the interpreter is not involved in the internal loop For a
static Array< bool > is_match(const std::string &pat, const string_vector &buffer, const regexp::opts &opt=regexp::opts(), const std::string &who="regexp")
static std::string replace(const std::string &pat, const std::string &buffer, const std::string &replacement, const regexp::opts &opt=regexp::opts(), const std::string &who="regexp")
void dotexceptnewline(bool val)
string_vector x_named_tokens
std::complex< double > w(std::complex< double > z, double relerr=0)
std::string replace(const std::string &buffer, const std::string &replacement)
string_vector named_tokens(void) const
bool is_match(const std::string &buffer)
is longer than or if then or only for unique occurrences of the complete pattern(false). The default is true. If a cell array of strings ar
std::string match_string(void) const
bool dotexceptnewline(void) const
match_data match(const std::string &buffer)
bool emptymatch(void) const
regexp(const std::string &pat="", const regexp::opts &opt=regexp::opts(), const std::string &w="regexp")
void emptymatch(bool val)
base_list & operator=(const base_list &bl)
match_element(const match_element &a)
match_data(const match_data &rx_lst)
string_vector named_patterns(void)
OCTAVE_EXPORT octave_value_list only variables visible in the local scope are displayed The following are valid options
static bool is_match(const std::string &pat, const std::string &buffer, const regexp::opts &opt=regexp::opts(), const std::string &who="regexp")
bool lineanchors(void) const
void case_insensitive(bool val)
void lineanchors(bool val)
If this string is the system will ring the terminal sometimes it is useful to be able to print the original representation of the string
std::string x_match_string
void compile(const std::string &pat, const regexp::opts &opt=regexp::opts())
string_vector tokens(void) const
void freespacing(bool val)