Skip to content

Class Ase::Re

ClassList > Ase > Re

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

  • #include <regex.hh>

Public Types

Type Name
enum int32_t Flags

Public Static Functions

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

Public Types Documentation

enum Flags

enum Ase::Re::Flags {
    DEFAULT = 0,
    ERE = 1 <<  0,
    I = 1 <<  4,
    M = 1 <<  5,
    N = 1 <<  6,
    S = 1 <<  7,
    X = 1 <<  8,
    XX = 1 <<  9,
    J = 1 << 10,
    U = 1 << 11
};

Public Static Functions Documentation

function findall

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

function grep

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

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

function sub

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

function subn

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


The documentation for this class was generated from the following file /__w/anklang/anklang/ase/regex.hh