Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
regExpPosix Class Reference

Wrapper around POSIX extended regular expressions with some additional prefix-handling. The prefix-handling is loosely oriented on PCRE regular expressions and provides a simple means of tuning the expressions. More...

Public Types

typedef SubStrings< std::string > results_type
 
using meta = regExpCxx::meta
 

Public Member Functions

 regExpPosix () noexcept
 
 regExpPosix (const regExpPosix &)=delete
 
 regExpPosix (regExpPosix &&rgx) noexcept
 
 regExpPosix (const char *pattern, const bool ignoreCase=false)
 
 regExpPosix (const std::string &pattern, const bool ignoreCase=false)
 
 ~regExpPosix ()
 
bool empty () const noexcept
 
bool exists () const noexcept
 
bool negated () const noexcept
 
bool negate (bool on) noexcept
 
unsigned ngroups () const
 
bool clear ()
 
void swap (regExpPosix &rgx)
 
bool set (const char *pattern, bool ignoreCase=false)
 
bool set (const std::string &pattern, bool ignoreCase=false)
 
std::string::size_type find (const std::string &text) const
 
bool match (const std::string &text) const
 
bool match (const std::string &text, results_type &matches) const
 
bool search (const std::string &text) const
 
bool operator() (const std::string &text) const
 
void operator= (const regExpPosix &)=delete
 
void operator= (regExpPosix &&rgx)
 
void operator= (const char *pattern)
 
void operator= (const std::string &pattern)
 

Static Public Member Functions

static bool is_meta (const char c) noexcept
 
static bool is_meta (const std::string &str, const char quote='\\')
 

Static Public Attributes

static int grammar
 

Detailed Description

Wrapper around POSIX extended regular expressions with some additional prefix-handling. The prefix-handling is loosely oriented on PCRE regular expressions and provides a simple means of tuning the expressions.

The prefixes are detected as (?...) at the beginning of the regular expression. Any unknown/unsupported prefixes are silently ignored.

See also
The manpage regex(7) for more information about POSIX regular expressions. These differ somewhat from Perl and sed regular expressions.
Foam::regExp and Foam::regExpCxx
Warning
This class should not be used directly. Use the Foam::regExp typedef instead.
Deprecated:
This class will be superseded by Foam::regExpCxx as compiler support for regular expressions continues to improve.
Source files

Definition at line 80 of file regExpPosix.H.

Member Typedef Documentation

◆ results_type

typedef SubStrings<std::string> results_type

Definition at line 108 of file regExpPosix.H.

◆ meta

Definition at line 139 of file regExpPosix.H.

Constructor & Destructor Documentation

◆ regExpPosix() [1/5]

regExpPosix ( )
inlinenoexcept

Definition at line 25 of file regExpPosixI.H.

◆ regExpPosix() [2/5]

regExpPosix ( const regExpPosix )
delete

◆ regExpPosix() [3/5]

regExpPosix ( regExpPosix &&  rgx)
inlinenoexcept

Definition at line 32 of file regExpPosixI.H.

◆ regExpPosix() [4/5]

regExpPosix ( const char *  pattern,
const bool  ignoreCase = false 
)
inlineexplicit

Definition at line 43 of file regExpPosixI.H.

References Foam::BitOps::set().

Here is the call graph for this function:

◆ regExpPosix() [5/5]

regExpPosix ( const std::string &  pattern,
const bool  ignoreCase = false 
)
inlineexplicit

Definition at line 56 of file regExpPosixI.H.

References Foam::BitOps::set().

Here is the call graph for this function:

◆ ~regExpPosix()

~regExpPosix ( )
inline

Definition at line 70 of file regExpPosixI.H.

References clear().

Here is the call graph for this function:

Member Function Documentation

◆ is_meta() [1/2]

static bool is_meta ( const char  c)
inlinestaticnoexcept

Definition at line 120 of file regExpPosix.H.

References Foam::constant::universal::c, and regExpCxx::is_meta().

Referenced by wordRe::compile().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_meta() [2/2]

static bool is_meta ( const std::string &  str,
const char  quote = '\\' 
)
inlinestatic

Definition at line 127 of file regExpPosix.H.

References regExpCxx::is_meta().

Here is the call graph for this function:

◆ empty()

bool empty ( ) const
inlinenoexcept

Definition at line 78 of file regExpPosixI.H.

◆ exists()

bool exists ( ) const
inlinenoexcept

Definition at line 84 of file regExpPosixI.H.

◆ negated()

bool negated ( ) const
inlinenoexcept

Definition at line 90 of file regExpPosixI.H.

◆ negate()

bool negate ( bool  on)
inlinenoexcept

Definition at line 96 of file regExpPosixI.H.

◆ ngroups()

unsigned ngroups ( ) const
inline

Definition at line 116 of file regExpPosixI.H.

◆ clear()

bool clear ( )

Definition at line 128 of file regExpPosix.C.

◆ swap()

void swap ( regExpPosix rgx)
inline

Definition at line 160 of file regExpPosixI.H.

◆ set() [1/2]

bool set ( const char *  pattern,
bool  ignoreCase = false 
)
inline

Definition at line 122 of file regExpPosixI.H.

◆ set() [2/2]

bool set ( const std::string &  pattern,
bool  ignoreCase = false 
)
inline

Definition at line 134 of file regExpPosixI.H.

◆ find()

std::string::size_type find ( const std::string &  text) const

Definition at line 144 of file regExpPosix.C.

◆ match() [1/2]

bool match ( const std::string &  text) const

Definition at line 187 of file regExpPosix.C.

Referenced by keyType::match(), and STARCDsurfaceFormatCore::readInpCellTable().

Here is the caller graph for this function:

◆ match() [2/2]

bool match ( const std::string &  text,
results_type matches 
) const

◆ search()

bool search ( const std::string &  text) const
inline

Definition at line 145 of file regExpPosixI.H.

References Foam::ListOps::find().

Here is the call graph for this function:

◆ operator()()

bool operator() ( const std::string &  text) const
inline

Definition at line 173 of file regExpPosixI.H.

References Foam::stringOps::match().

Here is the call graph for this function:

◆ operator=() [1/4]

void operator= ( const regExpPosix )
delete

◆ operator=() [2/4]

void operator= ( regExpPosix &&  rgx)
inline

Definition at line 179 of file regExpPosixI.H.

References clear().

Here is the call graph for this function:

◆ operator=() [3/4]

void operator= ( const char *  pattern)
inline

Definition at line 190 of file regExpPosixI.H.

References Foam::BitOps::set().

Here is the call graph for this function:

◆ operator=() [4/4]

void operator= ( const std::string &  pattern)
inline

Definition at line 196 of file regExpPosixI.H.

References Foam::BitOps::set().

Here is the call graph for this function:

Member Data Documentation

◆ grammar

int grammar
static

Definition at line 114 of file regExpPosix.H.


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