Gnome XML Library Reference Manual |
---|
xmlregexp —
struct xmlRegexp; typedef xmlRegexpPtr; struct xmlRegExecCtxt; typedef xmlRegExecCtxtPtr; xmlRegexpPtr xmlRegexpCompile (const xmlChar *regexp); void xmlRegFreeRegexp (xmlRegexpPtr regexp); int xmlRegexpExec (xmlRegexpPtr comp, const xmlChar *value); void xmlRegexpPrint (FILE *output, xmlRegexpPtr regexp); int xmlRegexpIsDeterminist (xmlRegexpPtr comp); void (*xmlRegExecCallbacks) (xmlRegExecCtxtPtr exec, const xmlChar *token, void *transdata, void *inputdata); xmlRegExecCtxtPtr xmlRegNewExecCtxt (xmlRegexpPtr comp, xmlRegExecCallbacks callback, void *data); void xmlRegFreeExecCtxt (xmlRegExecCtxtPtr exec); int xmlRegExecPushString (xmlRegExecCtxtPtr exec, const xmlChar *value, void *data); int xmlRegExecPushString2 (xmlRegExecCtxtPtr exec, const xmlChar *value, const xmlChar *value2, void *data);
typedef xmlRegexp *xmlRegexpPtr;
A libxml regular expression, they can actually be far more complex thank the POSIX regex expressions.
typedef xmlRegExecCtxt *xmlRegExecCtxtPtr;
A libxml progressive regular expression evaluation context
xmlRegexpPtr xmlRegexpCompile (const xmlChar *regexp);
Parses a regular expression conforming to XML Schemas Part 2 Datatype Appendix F and build an automata suitable for testing strings against that regular expression
regexp : | a regular expression string |
Returns : | the compiled expression or NULL in case of error |
int xmlRegexpExec (xmlRegexpPtr comp, const xmlChar *value);
Check if the regular expression generate the value
comp : | the compiled regular expression |
value : | |
Returns : | 1 if it matches, 0 if not and a negativa value in case of error |
void xmlRegexpPrint (FILE *output, xmlRegexpPtr regexp);
Print the content of the compiled regular expression
output : | the file for the output debug |
regexp : | the compiled regexp |
int xmlRegexpIsDeterminist (xmlRegexpPtr comp);
Check if the regular expression is determinist
comp : | the compiled regular expression |
Returns : | 1 if it yes, 0 if not and a negativa value in case of error |
void (*xmlRegExecCallbacks) (xmlRegExecCtxtPtr exec, const xmlChar *token, void *transdata, void *inputdata);
exec : | |
token : | |
transdata : | |
inputdata : |
xmlRegExecCtxtPtr xmlRegNewExecCtxt (xmlRegexpPtr comp, xmlRegExecCallbacks callback, void *data);
Build a context used for progressive evaluation of a regexp.
comp : | a precompiled regular expression |
callback : | a callback function used for handling progresses in the automata matching phase |
data : | the context data associated to the callback in this context |
Returns : | the new context |
void xmlRegFreeExecCtxt (xmlRegExecCtxtPtr exec);
Free the structures associated to a regular expression evaulation context.
exec : | a regular expression evaulation context |
int xmlRegExecPushString (xmlRegExecCtxtPtr exec, const xmlChar *value, void *data);
Push one input token in the execution context
exec : | a regexp execution context or NULL to indicate the end |
value : | a string token input |
data : | data associated to the token to reuse in callbacks |
Returns : | 1 if the regexp reached a final state, 0 if non-final, and a negative value in case of error. |
int xmlRegExecPushString2 (xmlRegExecCtxtPtr exec, const xmlChar *value, const xmlChar *value2, void *data);
Push one input token in the execution context
exec : | a regexp execution context or NULL to indicate the end |
value : | the first string token input |
value2 : | the second string token input |
data : | data associated to the token to reuse in callbacks |
Returns : | 1 if the regexp reached a final state, 0 if non-final, and a negative value in case of error. |
<< xmlmemory | xmlautomata >> |