GNU Octave  6.2.0
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 regexp &)=default
 
 regexp (const std::string &pat="", const regexp::opts &opt=regexp::opts(), const std::string &w="regexp")
 
 ~regexp (void)
 
void compile (const std::string &pat, const regexp::opts &opt=regexp::opts())
 
bool is_match (const std::string &buffer)
 
Array< bool > is_match (const string_vector &buffer)
 
match_data match (const std::string &buffer)
 
regexpoperator= (const regexp &rx)=default
 
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< bool > is_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 * m_data
 
Array< int > m_named_idx
 
string_vector m_named_pats
 
int m_names
 
opts m_options
 
std::string m_pattern
 
std::string m_who
 

Detailed Description

Definition at line 42 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 51 of file lo-regexp.h.

◆ regexp() [2/2]

octave::regexp::regexp ( const regexp )
default

◆ ~regexp()

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

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

References free().

Member Function Documentation

◆ compile()

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

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

◆ compile_internal()

◆ free()

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

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

References m_data.

Referenced by compile_internal().

◆ is_match() [1/4]

◆ is_match() [2/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 94 of file lo-regexp.h.

References is_match().

◆ is_match() [3/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 104 of file lo-regexp.h.

References is_match().

◆ is_match() [4/4]

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

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

References is_match(), len, string_vector::numel(), and retval.

◆ 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 84 of file lo-regexp.h.

References match().

◆ operator=()

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

◆ 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 114 of file lo-regexp.h.

References replace().

Member Data Documentation

◆ m_data

void* octave::regexp::m_data
private

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

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

◆ m_named_idx

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

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

Referenced by compile_internal(), and match().

◆ m_named_pats

string_vector octave::regexp::m_named_pats
private

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

Referenced by compile_internal(), and match().

◆ m_names

int octave::regexp::m_names
private

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

Referenced by compile_internal(), and match().

◆ m_options

opts octave::regexp::m_options
private

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

Referenced by compile_internal(), and match().

◆ m_pattern

std::string octave::regexp::m_pattern
private

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

Referenced by compile_internal().

◆ m_who

std::string octave::regexp::m_who
private

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

Referenced by compile_internal(), and match().


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