bes  Updated for version 3.20.6
BESRegex Class Reference

#include <BESRegex.h>

Collaboration diagram for BESRegex:
Collaboration graph

Public Member Functions

 BESRegex (const char *t)
 
 BESRegex (const char *t, int dummy)
 
int match (const char *s, int len, int pos=0)
 Does the pattern match. More...
 
int search (const char *s, int len, int &matchlen, int pos=0)
 How much of the string does the pattern matche. More...
 

Detailed Description

a C++ interface to POSIX regular expression functions.

Author
James Gallagher jgall.nosp@m.aghe.nosp@m.r@ope.nosp@m.ndap.nosp@m..org

Definition at line 41 of file BESRegex.h.

Constructor & Destructor Documentation

◆ BESRegex() [1/2]

BESRegex::BESRegex ( const char *  t)

Initialize a POSIX regular expression (using the 'extended' features).

Parameters
tThe regular expression pattern.

Definition at line 83 of file BESRegex.cc.

◆ BESRegex() [2/2]

BESRegex::BESRegex ( const char *  t,
int  dummy 
)

Compatability ctor.

See also
BESRegex::BESRegex(const char* t)

Definition at line 90 of file BESRegex.cc.

Member Function Documentation

◆ match()

int BESRegex::match ( const char *  s,
int  len,
int  pos = 0 
)

Does the pattern match.

Does the regular expression match the string? Warning : this function can be used to match strings of zero length if the regex pattern accepts empty strings. Therefore this function returns -1 if the pattern does not match.

Parameters
sThe string
lenThe length of string to consider
posStart looking at this position in the string
Returns
The number of characters that match, -1 if there's no match.

Definition at line 105 of file BESRegex.cc.

◆ search()

int BESRegex::search ( const char *  s,
int  len,
int &  matchlen,
int  pos = 0 
)

How much of the string does the pattern matche.

Does the regular expression match the string?

Parameters
sThe string
lenThe length of string to consider
matchlenReturn the length of the matched portion in this value-result parameter.
posStart looking at this position in the string
Returns
The start position of the first match. This is different from POSIX regular expressions, which return the start position of the longest match.

Definition at line 135 of file BESRegex.cc.


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