CrystalSpace

Public API Reference

Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

csRegExpMatcher Class Reference

Matcher for regular expressions. More...

#include <csutil/regexp.h>

List of all members.

Public Member Functions

 csRegExpMatcher (const char *pattern, bool extendedRE=false)
 Create a new RE matcher.
 ~csRegExpMatcher ()
 Destructor.
csRegExpMatchError Match (const char *string, int flags=0)
 Match a string against the pattern.
csRegExpMatchError Match (const char *string, csArray< csRegExpMatch > &matches, int flags=0)
 Match a string against the pattern.


Detailed Description

Matcher for regular expressions.

Note:
Implementation note: if the platform supports it, this class wraps the runtime libraries POSIX.2 regular expression interface; otherwise, it uses a built-in implementation of POSIX.2 regular expression (borrowed from glibc.) Both of them utiltize "compilation" of pattern for faster repeated matching of the same pattern. Although compilation is transparent, you should be aware that calls to Match() with different flags than previous calls cause a recompilation of the pattern. Thus, to improve performance, same flags should be used for subsequent calls to Match().

Definition at line 153 of file regexp.h.


Constructor & Destructor Documentation

csRegExpMatcher::csRegExpMatcher const char *  pattern,
bool  extendedRE = false
 

Create a new RE matcher.

Parameters:
pattern Pattern to match against.
extendedRE Treat the pattern as an extended regular expression, rather than as a basic regular expression.

csRegExpMatcher::~csRegExpMatcher  ) 
 

Destructor.


Member Function Documentation

csRegExpMatchError csRegExpMatcher::Match const char *  string,
csArray< csRegExpMatch > &  matches,
int  flags = 0
 

Match a string against the pattern.

Parameters:
string String against which to attempt match.
matches Array receiving the locations of individual (sub)expression matches.
flags One or more of csRegExpMatchFlags. Flags are combined using the bitwise-or | operator.
Returns:
NoError in case of success, else an error code.
Note:
Also check the "Implementation note" in the csRegExpMatcher description.

csRegExpMatchError csRegExpMatcher::Match const char *  string,
int  flags = 0
 

Match a string against the pattern.

Parameters:
string String against which to attempt match.
flags One or more of csRegExpMatchFlags. Flags are combined using the bitwise-or | operator.
Returns:
NoError in case of success, else an error code.
Note:
Also check the "Implementation note" in the csRegExpMatcher description.


The documentation for this class was generated from the following file:
Generated for Crystal Space by doxygen 1.3.9.1