Anklang 0.3.0-460-gc4ef46ba
ASE — Anklang Sound Engine (C++)

« « « Anklang Documentation
Loading...
Searching...
No Matches
Public Types | Static Public Member Functions | List of all members
Ase::Re Class Referencefinal

Wrapper for std::regex to simplify usage and reduce compilation time. More...

#include "regex.hh"

Public Types

enum  Flags : int32_t {
  DEFAULT , ERE , I , M ,
  N , S , X , XX ,
  J , U
}
 

Static Public Member Functions

static StringS findall (const String &regex, const String &input, Flags=DEFAULT)
 Find regex in input and return non-overlapping matches.
 
static ssize_t search (const String &regex, const String &input, Flags=DEFAULT)
 Find regex in input and return match position >= 0 or return < 0 otherwise.
 
static String grep (const String &regex, const String &input, int group=0, Flags=DEFAULT)
 Find regex in input and return matching string.
 
static String sub (const String &regex, const String &subst, const String &input, Flags=DEFAULT)
 Substitute regex in input by sbref with backreferences $00…$99 or $&.
 
static String sub (const String &regex, const String &subst, const String &input, uint count, Flags=DEFAULT)
 Substitute regex in input with subst up to count times.
 

Detailed Description

Wrapper for std::regex to simplify usage and reduce compilation time.

Definition at line 10 of file regex.hh.

Member Enumeration Documentation

◆ Flags

enum Ase::Re::Flags : int32_t

Definition at line 12 of file regex.hh.

Member Function Documentation

◆ findall()

StringS Ase::Re::findall ( const String regex,
const String input,
Flags  flags = DEFAULT 
)
static

Find regex in input and return non-overlapping matches.

Definition at line 233 of file regex.cc.

◆ grep()

String Ase::Re::grep ( const String regex,
const String input,
int  group = 0,
Flags  flags = DEFAULT 
)
static

Find regex in input and return matching string.

Definition at line 225 of file regex.cc.

Referenced by Ase::WebSocketConnection::authenticated().

◆ search()

ssize_t Ase::Re::search ( const String regex,
const String input,
Flags  flags = DEFAULT 
)
static

Find regex in input and return match position >= 0 or return < 0 otherwise.

Definition at line 217 of file regex.cc.

Referenced by Ase::WebSocketConnection::http_request().

◆ sub() [1/2]

String Ase::Re::sub ( const String regex,
const String subst,
const String input,
Flags  flags = DEFAULT 
)
static

Substitute regex in input by sbref with backreferences $00…$99 or $&.

Definition at line 249 of file regex.cc.

◆ sub() [2/2]

String Ase::Re::sub ( const String regex,
const String subst,
const String input,
uint  count,
Flags  flags = DEFAULT 
)
static

Substitute regex in input with subst up to count times.

Definition at line 241 of file regex.cc.


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