libdap  Updated for version 3.20.6
libdap4 is an implementation of OPeNDAP's DAP protocol.
libdap::Regex Class Reference

#include <GNURegex.h>

Public Member Functions

int match (const char *s, int len, int pos=0)
 Does the pattern match. More...
 
 Regex (const char *t)
 
 Regex (const char *t, int dummy)
 
int search (const char *s, int len, int &matchlen, int pos=0)
 How much of the string does the pattern match. 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 35 of file GNURegex.h.

Constructor & Destructor Documentation

◆ Regex() [1/2]

libdap::Regex::Regex ( const char *  t)

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

Parameters
tThe regular expression pattern.

Definition at line 96 of file GNURegex.cc.

◆ Regex() [2/2]

libdap::Regex::Regex ( const char *  t,
int  dummy 
)

Compatability ctor.

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

Definition at line 103 of file GNURegex.cc.

Member Function Documentation

◆ match()

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

Does the pattern match.

Does the regular expression match the string?

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 115 of file GNURegex.cc.

◆ search()

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

How much of the string does the pattern match.

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, whcih return the start position of the longest match.

Definition at line 147 of file GNURegex.cc.


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