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)
75 void compile (
const std::string& pat,
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);