microregex.h File Reference

Go to the source code of this file.

Typedefs

typedef void * microregex_t
typedef void * microregex_nfa_t
typedef void * microregex_state_t

Functions

microregex_t microregex_create (char *regex)
void microregex_destroy (microregex_t *regex_obj)
void microregex_set_case_insensitivity (microregex_t regex_obj, int val)
void microregex_state_destroy (microregex_state_t *st)
microregex_state_t microregex_match (microregex_t regex_obj, char *str, int start)
int microregex_state_get_num_captured (microregex_state_t st)
int microregex_state_get_match_begin (microregex_state_t st)
char * microregex_state_get_subexpression (microregex_state_t st, int n)


Typedef Documentation

typedef void* microregex_nfa_t

typedef void* microregex_state_t

typedef void* microregex_t


Function Documentation

microregex_t microregex_create ( char *  regex  ) 

Create regular expression object.

Parameters:
regex The regular expression to parse.
Returns:
The created regular expression object.

void microregex_destroy ( microregex_t regex_obj  ) 

Destroy regular expression object.

Parameters:
regex_obj The regular expression object to destroy.

microregex_state_t microregex_match ( microregex_t  regex_obj,
char *  str,
int  start 
)

Match text based on given regex.

Parameters:
regex_obj The regular expression object to use.
str The string in which to find the given regex.
start Starting index inside string
Returns:
A match object with specified match info.

void microregex_set_case_insensitivity ( microregex_t  regex_obj,
int  val 
)

Set case insensitivity of regular expression.

Parameters:
regex_obj The regular expression object to edit.
val Value to set flag to.

void microregex_state_destroy ( microregex_state_t st  ) 

Destroys state object.

Parameters:
st Pointer to state object to destroy.

int microregex_state_get_match_begin ( microregex_state_t  st  ) 

Get the location of the match

Parameters:
st The state object to use.
Returns:
The location of the match.

int microregex_state_get_num_captured ( microregex_state_t  st  ) 

Get the number of substrings captured by parenthesis.

Parameters:
st The state object to use.
Returns:
The number of subexpressions captured by this match.

char* microregex_state_get_subexpression ( microregex_state_t  st,
int  n 
)

Get the substring captured by parenthesis

Parameters:
st The state object to use.
n The subexpression number (0 = entire match)
Returns:
The string captured by the subexpression.


Generated on Sat Aug 30 02:08:37 2008 for microregex by  doxygen 1.5.6