libGimbal 0.1.0
C17-Based Extended Standard Library and Cross-Language Runtime Framework
|
#include <gimbal_pattern.h>
Related Symbols | |
(Note that these are not member symbols.) | |
Lifetime Management | |
Methods for creating, referencing, and unreferencing patterns | |
const GblPattern * | GblPattern_create (const char *pRegExp) |
const GblPattern * | GblPattern_ref (const GblPattern *pSelf) |
GblRefCount | GblPattern_unref (const GblPattern *pSelf) |
GblRefCount | GblPattern_refCount (const GblPattern *pSelf) |
GblRefCount | GblPattern_totalCount (void) |
Properties and Operators | |
Methods for getters and basic operations | |
int | GblPattern_compare (const GblPattern *pSelf, const GblPattern *pRhs) |
GblBool | GblPattern_equals (const GblPattern *pSelf, const GblPattern *pRhs) |
size_t | GblPattern_bytes (const GblPattern *pSelf) |
const char * | GblPattern_string (const GblPattern *pSelf, GblStringBuffer *pBuff) |
Matching | |
Methods for generic pattern matching | |
GblBool | GblPattern_match (const GblPattern *pSelf, const char *pString, GblStringView *pMatch, int *pCount) |
GblBool | GblPattern_matchStr (const char *pRegExp, const char *pString, GblStringView *pMatch, int *pCount) |
Inverse Matching | |
Methods for returning non matches | |
GblBool | GblPattern_matchNot (const GblPattern *pSelf, const char *pString, GblStringView *pMatch, int *pCount) |
GblBool | GblPattern_matchNotStr (const char *pRegExp, const char *pString, GblStringView *pMatch, int *pCount) |
Exact Matching | |
Methods for checking exact matches | |
GblBool | GblPattern_matchExact (const GblPattern *pSelf, const char *pString) |
GblBool | GblPattern_matchExactStr (const char *pRegExp, const char *pString) |
Match Counting | |
Methods used for counting matches | |
size_t | GblPattern_matchCount (const GblPattern *pSelf, const char *pString) |
size_t | GblPattern_matchCountStr (const char *pRegExp, const char *pString) |
Opaque structure containing a compiled regular expression.
GblPattern is the compiled version of a regular expression string, produced by GblPattern_create(). It is faster than working with raw regular expression strings, since preprocessing has already been done.
It is advised that when you are repeatedly using the same regular expression, you store it and use it as a GblPattern.
|
related |
Compiles the given regular expression into a pre-processed GblPattern.
|
related |
Returns a new reference to an existing pattern, incrementing its refcount.
|
related |
Releases a reference to a pattern, deallocating it upon reaching zero.
|
related |
Returns the number of active references held to the given compiled pattern.
|
related |
Returns the total number of active, allocated, compiled regex patterns.
|
related |
Compares two different compiled patterns to see if they are equivalent regexes.
|
related |
Compares two different compiled patterns for exact value equality of their regexes.
|
related |
Counts the total size of a compiled pattern and returns it in bytes.
|
related |
Reconstructs an approximate string representation of the compiled pattern.
|
related |
Finds the numbered match given by pCount
, or 1 if NULL.
GblPattern_match() searches through pString
for substrings which match the pattern given by pSelf
. When it has found the number of matches equal to the value given by pCount
(or 1 if pCount
is NULL), pMatch
is set to the substring of the final match (or ignored when NULL) and GBL_TRUE is returned. If the match could not be found, GBL_FALSE is returned.
pCount
points to a value of 0, no matches are expected to be found. If a match is found, GBL_FALSE is returned, otherwise GBL_TRUE is returned (inverted from normal).pCount
points to a value of -1, all matches are searched, with pMatch
being updated to point to the final one and pCount
being updated to store the final number of matches.pSelf | The precompiled regular expression pattern |
pString | The input string to search for matches within |
pMatch | (Optional) Output used to hold the final match substring |
pCount | (Optional, defaults to 1) Number of matches to find |
GBL_FALSE | The requested match number wasn't found. |
GBL_TRUE | The requested match number was found. |
|
related |
Dynamically-compiled string-based version of GblPattern_match()
|
related |
Behaves like GblPattern_match() except searching for NON-MATCHES.
|
related |
Dynamically-compiled string-based version of GblPattern_matchNot()
|
related |
Returns GBL_TRUE if the given string EXACTLY matches the given pattern or GBL_FALSE otherwise.
|
related |
Dynamically compiled string-based version of GblPattern_matchExact()
|
related |
Returns the number of pattern matches found in pString
.
|
related |
Dynamically compiled, string-based version of GblPattern_matchExact()