GNU Octave  4.4.1
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
octave::regexp Class Reference

#include "lo-regexp.h"

Collaboration diagram for octave::regexp:

Classes

class  match_data
 
class  match_element
 
class  opts
 

Public Member Functions

 regexp (const std::string &pat="", const regexp::opts &opt=regexp::opts(), const std::string &w="regexp")
 
 regexp (const regexp &rx)
 
 ~regexp (void)
 
void compile (const std::string &pat, const regexp::opts &opt=regexp::opts())
 
bool is_match (const std::string &buffer)
 
Array< boolis_match (const string_vector &buffer)
 
match_data match (const std::string &buffer)
 
regexpoperator= (const regexp &rx)
 
std::string replace (const std::string &buffer, const std::string &replacement)
 

Static Public Member Functions

static bool is_match (const std::string &pat, const std::string &buffer, const regexp::opts &opt=regexp::opts(), const std::string &who="regexp")
 
static Array< boolis_match (const std::string &pat, const string_vector &buffer, const regexp::opts &opt=regexp::opts(), const std::string &who="regexp")
 
static regexp::match_data match (const std::string &pat, const std::string &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")
 

Private Member Functions

void compile_internal (void)
 
void free (void)
 

Private Attributes

void * data
 
std::string m
 
Array< int > named_idx
 
string_vector named_pats
 
int nnames
 
opts options
 
std::string pattern
 
std::string who
 

Detailed Description

Definition at line 40 of file lo-regexp.h.

Constructor & Destructor Documentation

◆ regexp() [1/2]

octave::regexp::regexp ( const std::string pat = "",
const regexp::opts opt = regexp::opts (),
const std::string w = "regexp" 
)
inline

Definition at line 49 of file lo-regexp.h.

◆ regexp() [2/2]

octave::regexp::regexp ( const regexp rx)
inline

Definition at line 58 of file lo-regexp.h.

◆ ~regexp()

octave::regexp::~regexp ( void  )
inline

Definition at line 77 of file lo-regexp.h.

Member Function Documentation

◆ compile()

void octave::regexp::compile ( const std::string pat,
const regexp::opts opt = regexp::opts () 
)
inline

Definition at line 79 of file lo-regexp.h.

References options, and pattern().

◆ compile_internal()

◆ free()

void octave::regexp::free ( void  )
private

Definition at line 63 of file lo-regexp.cc.

References data.

Referenced by compile_internal().

◆ is_match() [1/4]

bool octave::regexp::is_match ( const std::string buffer)

Definition at line 430 of file lo-regexp.cc.

References match(), and octave::base_list< elt_type >::size().

Referenced by is_match(), and octave::symbol_scope_rep::regexp().

◆ is_match() [2/4]

Array< bool > octave::regexp::is_match ( const string_vector buffer)

Definition at line 438 of file lo-regexp.cc.

References i, is_match(), Array< T >::numel(), and retval.

◆ is_match() [3/4]

static bool octave::regexp::is_match ( const std::string pat,
const std::string buffer,
const regexp::opts opt = regexp::opts (),
const std::string who = "regexp" 
)
inlinestatic

Definition at line 107 of file lo-regexp.h.

References is_match().

◆ is_match() [4/4]

static Array<bool> octave::regexp::is_match ( const std::string pat,
const string_vector buffer,
const regexp::opts opt = regexp::opts (),
const std::string who = "regexp" 
)
inlinestatic

Definition at line 117 of file lo-regexp.h.

References is_match().

◆ match() [1/2]

◆ match() [2/2]

static regexp::match_data octave::regexp::match ( const std::string pat,
const std::string buffer,
const regexp::opts opt = regexp::opts (),
const std::string who = "regexp" 
)
inlinestatic

Definition at line 97 of file lo-regexp.h.

References match().

◆ operator=()

regexp& octave::regexp::operator= ( const regexp rx)
inline

Definition at line 63 of file lo-regexp.h.

References data, named_idx, named_pats, nnames, pattern(), and pattern.

◆ replace() [1/2]

std::string octave::regexp::replace ( const std::string buffer,
const std::string replacement 
)

◆ replace() [2/2]

static std::string octave::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" 
)
inlinestatic

Definition at line 127 of file lo-regexp.h.

References replace().

Member Data Documentation

◆ data

void* octave::regexp::data
private

Definition at line 276 of file lo-regexp.h.

Referenced by compile_internal(), free(), match(), and operator=().

◆ m

std::string octave::regexp::m
private

Definition at line 278 of file lo-regexp.h.

◆ named_idx

Array<int> octave::regexp::named_idx
private

Definition at line 281 of file lo-regexp.h.

Referenced by compile_internal(), match(), and operator=().

◆ named_pats

string_vector octave::regexp::named_pats
private

Definition at line 279 of file lo-regexp.h.

Referenced by compile_internal(), match(), and operator=().

◆ nnames

int octave::regexp::nnames
private

Definition at line 280 of file lo-regexp.h.

Referenced by compile_internal(), match(), and operator=().

◆ options

opts octave::regexp::options
private

Definition at line 273 of file lo-regexp.h.

Referenced by compile_internal(), and match().

◆ pattern

std::string octave::regexp::pattern
private

Definition at line 271 of file lo-regexp.h.

Referenced by compile_internal(), and operator=().

◆ who

std::string octave::regexp::who
private

Definition at line 282 of file lo-regexp.h.

Referenced by compile_internal(), and match().


The documentation for this class was generated from the following files: