xref: /aosp_15_r20/external/libxml2/doc/devhelp/libxml2-xmlregexp.html (revision 7c5688314b92172186c154356a6374bf7684c3ca)
1<html>
2<head>
3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
4<title>xmlregexp: regular expressions handling</title>
5<meta name="generator" content="Libxml2 devhelp stylesheet">
6<link rel="start" href="index.html" title="libxml2 Reference Manual">
7<link rel="up" href="general.html" title="API">
8<link rel="stylesheet" href="style.css" type="text/css">
9<link rel="chapter" href="general.html" title="API">
10</head>
11<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
12<table class="navigation" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle">
13<td><a accesskey="p" href="libxml2-xmlreader.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
14<td><a accesskey="u" href="general.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
15<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
16<td><a accesskey="n" href="libxml2-xmlsave.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
17<th width="100%" align="center">libxml2 Reference Manual</th>
18</tr></table>
19<h2><span class="refentrytitle">xmlregexp</span></h2>
20<p>xmlregexp - regular expressions handling</p>
21<p>basic API for libxml regular expressions handling used for XML Schemas and validation. </p>
22<p>Author(s): Daniel Veillard </p>
23<div class="refsynopsisdiv">
24<h2>Synopsis</h2>
25<pre class="synopsis">typedef struct _xmlExpCtxt <a href="#xmlExpCtxt">xmlExpCtxt</a>;
26typedef <a href="libxml2-xmlregexp.html#xmlExpCtxt">xmlExpCtxt</a> * <a href="#xmlExpCtxtPtr">xmlExpCtxtPtr</a>;
27typedef struct _xmlExpNode <a href="#xmlExpNode">xmlExpNode</a>;
28typedef <a href="libxml2-xmlregexp.html#xmlExpNode">xmlExpNode</a> * <a href="#xmlExpNodePtr">xmlExpNodePtr</a>;
29typedef enum <a href="#xmlExpNodeType">xmlExpNodeType</a>;
30typedef struct _xmlRegExecCtxt <a href="#xmlRegExecCtxt">xmlRegExecCtxt</a>;
31typedef <a href="libxml2-xmlregexp.html#xmlRegExecCtxt">xmlRegExecCtxt</a> * <a href="#xmlRegExecCtxtPtr">xmlRegExecCtxtPtr</a>;
32typedef struct _xmlRegexp <a href="#xmlRegexp">xmlRegexp</a>;
33typedef <a href="libxml2-xmlregexp.html#xmlRegexp">xmlRegexp</a> * <a href="#xmlRegexpPtr">xmlRegexpPtr</a>;
34int	<a href="#xmlExpCtxtNbCons">xmlExpCtxtNbCons</a>		(<a href="libxml2-xmlregexp.html#xmlExpCtxtPtr">xmlExpCtxtPtr</a> ctxt);
35int	<a href="#xmlExpCtxtNbNodes">xmlExpCtxtNbNodes</a>		(<a href="libxml2-xmlregexp.html#xmlExpCtxtPtr">xmlExpCtxtPtr</a> ctxt);
36void	<a href="#xmlExpDump">xmlExpDump</a>			(<a href="libxml2-tree.html#xmlBufferPtr">xmlBufferPtr</a> buf, <br>					 <a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a> expr);
37<a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a>	<a href="#xmlExpExpDerive">xmlExpExpDerive</a>		(<a href="libxml2-xmlregexp.html#xmlExpCtxtPtr">xmlExpCtxtPtr</a> ctxt, <br>					 <a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a> exp, <br>					 <a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a> sub);
38void	<a href="#xmlExpFree">xmlExpFree</a>			(<a href="libxml2-xmlregexp.html#xmlExpCtxtPtr">xmlExpCtxtPtr</a> ctxt, <br>					 <a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a> exp);
39void	<a href="#xmlExpFreeCtxt">xmlExpFreeCtxt</a>			(<a href="libxml2-xmlregexp.html#xmlExpCtxtPtr">xmlExpCtxtPtr</a> ctxt);
40int	<a href="#xmlExpGetLanguage">xmlExpGetLanguage</a>		(<a href="libxml2-xmlregexp.html#xmlExpCtxtPtr">xmlExpCtxtPtr</a> ctxt, <br>					 <a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a> exp, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> ** langList, <br>					 int len);
41int	<a href="#xmlExpGetStart">xmlExpGetStart</a>			(<a href="libxml2-xmlregexp.html#xmlExpCtxtPtr">xmlExpCtxtPtr</a> ctxt, <br>					 <a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a> exp, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> ** tokList, <br>					 int len);
42int	<a href="#xmlExpIsNillable">xmlExpIsNillable</a>		(<a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a> exp);
43int	<a href="#xmlExpMaxToken">xmlExpMaxToken</a>			(<a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a> expr);
44<a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a>	<a href="#xmlExpNewAtom">xmlExpNewAtom</a>		(<a href="libxml2-xmlregexp.html#xmlExpCtxtPtr">xmlExpCtxtPtr</a> ctxt, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * name, <br>					 int len);
45<a href="libxml2-xmlregexp.html#xmlExpCtxtPtr">xmlExpCtxtPtr</a>	<a href="#xmlExpNewCtxt">xmlExpNewCtxt</a>		(int maxNodes, <br>					 <a href="libxml2-dict.html#xmlDictPtr">xmlDictPtr</a> dict);
46<a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a>	<a href="#xmlExpNewOr">xmlExpNewOr</a>		(<a href="libxml2-xmlregexp.html#xmlExpCtxtPtr">xmlExpCtxtPtr</a> ctxt, <br>					 <a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a> left, <br>					 <a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a> right);
47<a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a>	<a href="#xmlExpNewRange">xmlExpNewRange</a>		(<a href="libxml2-xmlregexp.html#xmlExpCtxtPtr">xmlExpCtxtPtr</a> ctxt, <br>					 <a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a> subset, <br>					 int min, <br>					 int max);
48<a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a>	<a href="#xmlExpNewSeq">xmlExpNewSeq</a>		(<a href="libxml2-xmlregexp.html#xmlExpCtxtPtr">xmlExpCtxtPtr</a> ctxt, <br>					 <a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a> left, <br>					 <a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a> right);
49<a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a>	<a href="#xmlExpParse">xmlExpParse</a>		(<a href="libxml2-xmlregexp.html#xmlExpCtxtPtr">xmlExpCtxtPtr</a> ctxt, <br>					 const char * expr);
50void	<a href="#xmlExpRef">xmlExpRef</a>			(<a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a> exp);
51<a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a>	<a href="#xmlExpStringDerive">xmlExpStringDerive</a>	(<a href="libxml2-xmlregexp.html#xmlExpCtxtPtr">xmlExpCtxtPtr</a> ctxt, <br>					 <a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a> exp, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * str, <br>					 int len);
52int	<a href="#xmlExpSubsume">xmlExpSubsume</a>			(<a href="libxml2-xmlregexp.html#xmlExpCtxtPtr">xmlExpCtxtPtr</a> ctxt, <br>					 <a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a> exp, <br>					 <a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a> sub);
53typedef void <a href="#xmlRegExecCallbacks">xmlRegExecCallbacks</a>		(<a href="libxml2-xmlregexp.html#xmlRegExecCtxtPtr">xmlRegExecCtxtPtr</a> exec, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * token, <br>					 void * transdata, <br>					 void * inputdata);
54int	<a href="#xmlRegExecErrInfo">xmlRegExecErrInfo</a>		(<a href="libxml2-xmlregexp.html#xmlRegExecCtxtPtr">xmlRegExecCtxtPtr</a> exec, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> ** string, <br>					 int * nbval, <br>					 int * nbneg, <br>					 <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> ** values, <br>					 int * terminal);
55int	<a href="#xmlRegExecNextValues">xmlRegExecNextValues</a>		(<a href="libxml2-xmlregexp.html#xmlRegExecCtxtPtr">xmlRegExecCtxtPtr</a> exec, <br>					 int * nbval, <br>					 int * nbneg, <br>					 <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> ** values, <br>					 int * terminal);
56int	<a href="#xmlRegExecPushString">xmlRegExecPushString</a>		(<a href="libxml2-xmlregexp.html#xmlRegExecCtxtPtr">xmlRegExecCtxtPtr</a> exec, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * value, <br>					 void * data);
57int	<a href="#xmlRegExecPushString2">xmlRegExecPushString2</a>		(<a href="libxml2-xmlregexp.html#xmlRegExecCtxtPtr">xmlRegExecCtxtPtr</a> exec, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * value, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * value2, <br>					 void * data);
58void	<a href="#xmlRegFreeExecCtxt">xmlRegFreeExecCtxt</a>		(<a href="libxml2-xmlregexp.html#xmlRegExecCtxtPtr">xmlRegExecCtxtPtr</a> exec);
59void	<a href="#xmlRegFreeRegexp">xmlRegFreeRegexp</a>		(<a href="libxml2-xmlregexp.html#xmlRegexpPtr">xmlRegexpPtr</a> regexp);
60<a href="libxml2-xmlregexp.html#xmlRegExecCtxtPtr">xmlRegExecCtxtPtr</a>	<a href="#xmlRegNewExecCtxt">xmlRegNewExecCtxt</a>	(<a href="libxml2-xmlregexp.html#xmlRegexpPtr">xmlRegexpPtr</a> comp, <br>						 <a href="libxml2-xmlregexp.html#xmlRegExecCallbacks">xmlRegExecCallbacks</a> callback, <br>						 void * data);
61<a href="libxml2-xmlregexp.html#xmlRegexpPtr">xmlRegexpPtr</a>	<a href="#xmlRegexpCompile">xmlRegexpCompile</a>	(const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * regexp);
62int	<a href="#xmlRegexpExec">xmlRegexpExec</a>			(<a href="libxml2-xmlregexp.html#xmlRegexpPtr">xmlRegexpPtr</a> comp, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * content);
63int	<a href="#xmlRegexpIsDeterminist">xmlRegexpIsDeterminist</a>		(<a href="libxml2-xmlregexp.html#xmlRegexpPtr">xmlRegexpPtr</a> comp);
64void	<a href="#xmlRegexpPrint">xmlRegexpPrint</a>			(FILE * output, <br>					 <a href="libxml2-xmlregexp.html#xmlRegexpPtr">xmlRegexpPtr</a> regexp);
65</pre>
66</div>
67<div class="refsect1" lang="en"><h2>Description</h2></div>
68<div class="refsect1" lang="en">
69<h2>Details</h2>
70<div class="refsect2" lang="en">
71<div class="refsect2" lang="en">
72<h3>
73<a name="xmlExpCtxt">Structure </a>xmlExpCtxt</h3>
74<pre class="programlisting">struct _xmlExpCtxt {
75The content of this structure is not made public by the API.
76} xmlExpCtxt;
77</pre>
78<p></p>
79</div>
80<hr>
81<div class="refsect2" lang="en">
82<h3>
83<a name="xmlExpCtxtPtr">Typedef </a>xmlExpCtxtPtr</h3>
84<pre class="programlisting"><a href="libxml2-xmlregexp.html#xmlExpCtxt">xmlExpCtxt</a> * xmlExpCtxtPtr;
85</pre>
86<p></p>
87</div>
88<hr>
89<div class="refsect2" lang="en">
90<h3>
91<a name="xmlExpNode">Structure </a>xmlExpNode</h3>
92<pre class="programlisting">struct _xmlExpNode {
93The content of this structure is not made public by the API.
94} xmlExpNode;
95</pre>
96<p></p>
97</div>
98<hr>
99<div class="refsect2" lang="en">
100<h3>
101<a name="xmlExpNodePtr">Typedef </a>xmlExpNodePtr</h3>
102<pre class="programlisting"><a href="libxml2-xmlregexp.html#xmlExpNode">xmlExpNode</a> * xmlExpNodePtr;
103</pre>
104<p></p>
105</div>
106<hr>
107<div class="refsect2" lang="en">
108<h3>
109<a name="xmlExpNodeType">Enum </a>xmlExpNodeType</h3>
110<pre class="programlisting">enum <a href="#xmlExpNodeType">xmlExpNodeType</a> {
111    <a name="XML_EXP_EMPTY">XML_EXP_EMPTY</a> = 0
112    <a name="XML_EXP_FORBID">XML_EXP_FORBID</a> = 1
113    <a name="XML_EXP_ATOM">XML_EXP_ATOM</a> = 2
114    <a name="XML_EXP_SEQ">XML_EXP_SEQ</a> = 3
115    <a name="XML_EXP_OR">XML_EXP_OR</a> = 4
116    <a name="XML_EXP_COUNT">XML_EXP_COUNT</a> = 5
117};
118</pre>
119<p></p>
120</div>
121<hr>
122<div class="refsect2" lang="en">
123<h3>
124<a name="xmlRegExecCtxt">Structure </a>xmlRegExecCtxt</h3>
125<pre class="programlisting">struct _xmlRegExecCtxt {
126The content of this structure is not made public by the API.
127} xmlRegExecCtxt;
128</pre>
129<p></p>
130</div>
131<hr>
132<div class="refsect2" lang="en">
133<h3>
134<a name="xmlRegExecCtxtPtr">Typedef </a>xmlRegExecCtxtPtr</h3>
135<pre class="programlisting"><a href="libxml2-xmlregexp.html#xmlRegExecCtxt">xmlRegExecCtxt</a> * xmlRegExecCtxtPtr;
136</pre>
137<p>A libxml progressive regular expression evaluation context</p>
138</div>
139<hr>
140<div class="refsect2" lang="en">
141<h3>
142<a name="xmlRegexp">Structure </a>xmlRegexp</h3>
143<pre class="programlisting">struct _xmlRegexp {
144The content of this structure is not made public by the API.
145} xmlRegexp;
146</pre>
147<p></p>
148</div>
149<hr>
150<div class="refsect2" lang="en">
151<h3>
152<a name="xmlRegexpPtr">Typedef </a>xmlRegexpPtr</h3>
153<pre class="programlisting"><a href="libxml2-xmlregexp.html#xmlRegexp">xmlRegexp</a> * xmlRegexpPtr;
154</pre>
155<p>A libxml regular expression, they can actually be far more complex thank the POSIX regex expressions.</p>
156</div>
157<hr>
158<div class="refsect2" lang="en">
159<h3>
160<a name="xmlRegExecCallbacks"></a>Function type xmlRegExecCallbacks</h3>
161<pre class="programlisting">void	xmlRegExecCallbacks		(<a href="libxml2-xmlregexp.html#xmlRegExecCtxtPtr">xmlRegExecCtxtPtr</a> exec, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * token, <br>					 void * transdata, <br>					 void * inputdata)<br>
162</pre>
163<p>Callback function when doing a transition in the automata</p>
164<div class="variablelist"><table border="0">
165<col align="left">
166<tbody>
167<tr>
168<td><span class="term"><i><tt>exec</tt></i>:</span></td>
169<td>the regular expression context</td>
170</tr>
171<tr>
172<td><span class="term"><i><tt>token</tt></i>:</span></td>
173<td>the current token string</td>
174</tr>
175<tr>
176<td><span class="term"><i><tt>transdata</tt></i>:</span></td>
177<td>transition data</td>
178</tr>
179<tr>
180<td><span class="term"><i><tt>inputdata</tt></i>:</span></td>
181<td>input data</td>
182</tr>
183</tbody>
184</table></div>
185</div>
186<hr>
187<div class="refsect2" lang="en">
188<h3>
189<a name="emptyExp">Variable </a>emptyExp</h3>
190<pre class="programlisting"><a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a> emptyExp;
191</pre>
192<p></p>
193</div>
194<hr>
195<div class="refsect2" lang="en">
196<h3>
197<a name="forbiddenExp">Variable </a>forbiddenExp</h3>
198<pre class="programlisting"><a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a> forbiddenExp;
199</pre>
200<p></p>
201</div>
202<hr>
203<div class="refsect2" lang="en">
204<h3>
205<a name="xmlExpCtxtNbCons"></a>xmlExpCtxtNbCons ()</h3>
206<pre class="programlisting">int	xmlExpCtxtNbCons		(<a href="libxml2-xmlregexp.html#xmlExpCtxtPtr">xmlExpCtxtPtr</a> ctxt)<br>
207</pre>
208<p>Debugging facility provides the number of allocated nodes over lifetime</p>
209<div class="variablelist"><table border="0">
210<col align="left">
211<tbody>
212<tr>
213<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
214<td>an expression context</td>
215</tr>
216<tr>
217<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
218<td>the number of nodes ever allocated or -1 in case of error</td>
219</tr>
220</tbody>
221</table></div>
222</div>
223<hr>
224<div class="refsect2" lang="en">
225<h3>
226<a name="xmlExpCtxtNbNodes"></a>xmlExpCtxtNbNodes ()</h3>
227<pre class="programlisting">int	xmlExpCtxtNbNodes		(<a href="libxml2-xmlregexp.html#xmlExpCtxtPtr">xmlExpCtxtPtr</a> ctxt)<br>
228</pre>
229<p>Debugging facility provides the number of allocated nodes at a that point</p>
230<div class="variablelist"><table border="0">
231<col align="left">
232<tbody>
233<tr>
234<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
235<td>an expression context</td>
236</tr>
237<tr>
238<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
239<td>the number of nodes in use or -1 in case of error</td>
240</tr>
241</tbody>
242</table></div>
243</div>
244<hr>
245<div class="refsect2" lang="en">
246<h3>
247<a name="xmlExpDump"></a>xmlExpDump ()</h3>
248<pre class="programlisting">void	xmlExpDump			(<a href="libxml2-tree.html#xmlBufferPtr">xmlBufferPtr</a> buf, <br>					 <a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a> expr)<br>
249</pre>
250<p>Serialize the expression as compiled to the buffer</p>
251<div class="variablelist"><table border="0">
252<col align="left">
253<tbody>
254<tr>
255<td><span class="term"><i><tt>buf</tt></i>:</span></td>
256<td>a buffer to receive the output</td>
257</tr>
258<tr>
259<td><span class="term"><i><tt>expr</tt></i>:</span></td>
260<td>the compiled expression</td>
261</tr>
262</tbody>
263</table></div>
264</div>
265<hr>
266<div class="refsect2" lang="en">
267<h3>
268<a name="xmlExpExpDerive"></a>xmlExpExpDerive ()</h3>
269<pre class="programlisting"><a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a>	xmlExpExpDerive		(<a href="libxml2-xmlregexp.html#xmlExpCtxtPtr">xmlExpCtxtPtr</a> ctxt, <br>					 <a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a> exp, <br>					 <a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a> sub)<br>
270</pre>
271<p>Evaluates the expression resulting from @exp consuming a sub expression @sub Based on algebraic derivation and sometimes direct Brzozowski derivation it usually takes less than linear time and can handle expressions generating infinite languages.</p>
272<div class="variablelist"><table border="0">
273<col align="left">
274<tbody>
275<tr>
276<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
277<td>the expressions context</td>
278</tr>
279<tr>
280<td><span class="term"><i><tt>exp</tt></i>:</span></td>
281<td>the englobing expression</td>
282</tr>
283<tr>
284<td><span class="term"><i><tt>sub</tt></i>:</span></td>
285<td>the subexpression</td>
286</tr>
287<tr>
288<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
289<td>the resulting expression or NULL in case of internal error, the result must be freed</td>
290</tr>
291</tbody>
292</table></div>
293</div>
294<hr>
295<div class="refsect2" lang="en">
296<h3>
297<a name="xmlExpFree"></a>xmlExpFree ()</h3>
298<pre class="programlisting">void	xmlExpFree			(<a href="libxml2-xmlregexp.html#xmlExpCtxtPtr">xmlExpCtxtPtr</a> ctxt, <br>					 <a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a> exp)<br>
299</pre>
300<p>Dereference the expression</p>
301<div class="variablelist"><table border="0">
302<col align="left">
303<tbody>
304<tr>
305<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
306<td>the expression context</td>
307</tr>
308<tr>
309<td><span class="term"><i><tt>exp</tt></i>:</span></td>
310<td>the expression</td>
311</tr>
312</tbody>
313</table></div>
314</div>
315<hr>
316<div class="refsect2" lang="en">
317<h3>
318<a name="xmlExpFreeCtxt"></a>xmlExpFreeCtxt ()</h3>
319<pre class="programlisting">void	xmlExpFreeCtxt			(<a href="libxml2-xmlregexp.html#xmlExpCtxtPtr">xmlExpCtxtPtr</a> ctxt)<br>
320</pre>
321<p>Free an expression context</p>
322<div class="variablelist"><table border="0">
323<col align="left">
324<tbody><tr>
325<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
326<td>an expression context</td>
327</tr></tbody>
328</table></div>
329</div>
330<hr>
331<div class="refsect2" lang="en">
332<h3>
333<a name="xmlExpGetLanguage"></a>xmlExpGetLanguage ()</h3>
334<pre class="programlisting">int	xmlExpGetLanguage		(<a href="libxml2-xmlregexp.html#xmlExpCtxtPtr">xmlExpCtxtPtr</a> ctxt, <br>					 <a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a> exp, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> ** langList, <br>					 int len)<br>
335</pre>
336<p>Find all the strings used in @exp and store them in @list</p>
337<div class="variablelist"><table border="0">
338<col align="left">
339<tbody>
340<tr>
341<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
342<td>the expression context</td>
343</tr>
344<tr>
345<td><span class="term"><i><tt>exp</tt></i>:</span></td>
346<td>the expression</td>
347</tr>
348<tr>
349<td><span class="term"><i><tt>langList</tt></i>:</span></td>
350<td>where to store the tokens</td>
351</tr>
352<tr>
353<td><span class="term"><i><tt>len</tt></i>:</span></td>
354<td>the allocated length of @list</td>
355</tr>
356<tr>
357<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
358<td>the number of unique strings found, -1 in case of errors and -2 if there is more than @len strings</td>
359</tr>
360</tbody>
361</table></div>
362</div>
363<hr>
364<div class="refsect2" lang="en">
365<h3>
366<a name="xmlExpGetStart"></a>xmlExpGetStart ()</h3>
367<pre class="programlisting">int	xmlExpGetStart			(<a href="libxml2-xmlregexp.html#xmlExpCtxtPtr">xmlExpCtxtPtr</a> ctxt, <br>					 <a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a> exp, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> ** tokList, <br>					 int len)<br>
368</pre>
369<p>Find all the strings that appears at the start of the languages accepted by @exp and store them in @list. E.g. for (a, b) | c it will return the list [a, c]</p>
370<div class="variablelist"><table border="0">
371<col align="left">
372<tbody>
373<tr>
374<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
375<td>the expression context</td>
376</tr>
377<tr>
378<td><span class="term"><i><tt>exp</tt></i>:</span></td>
379<td>the expression</td>
380</tr>
381<tr>
382<td><span class="term"><i><tt>tokList</tt></i>:</span></td>
383<td>where to store the tokens</td>
384</tr>
385<tr>
386<td><span class="term"><i><tt>len</tt></i>:</span></td>
387<td>the allocated length of @list</td>
388</tr>
389<tr>
390<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
391<td>the number of unique strings found, -1 in case of errors and -2 if there is more than @len strings</td>
392</tr>
393</tbody>
394</table></div>
395</div>
396<hr>
397<div class="refsect2" lang="en">
398<h3>
399<a name="xmlExpIsNillable"></a>xmlExpIsNillable ()</h3>
400<pre class="programlisting">int	xmlExpIsNillable		(<a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a> exp)<br>
401</pre>
402<p>Finds if the expression is nillable, i.e. if it accepts the empty sequence</p>
403<div class="variablelist"><table border="0">
404<col align="left">
405<tbody>
406<tr>
407<td><span class="term"><i><tt>exp</tt></i>:</span></td>
408<td>the expression</td>
409</tr>
410<tr>
411<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
412<td>1 if nillable, 0 if not and -1 in case of error</td>
413</tr>
414</tbody>
415</table></div>
416</div>
417<hr>
418<div class="refsect2" lang="en">
419<h3>
420<a name="xmlExpMaxToken"></a>xmlExpMaxToken ()</h3>
421<pre class="programlisting">int	xmlExpMaxToken			(<a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a> expr)<br>
422</pre>
423<p>Indicate the maximum number of input a expression can accept</p>
424<div class="variablelist"><table border="0">
425<col align="left">
426<tbody>
427<tr>
428<td><span class="term"><i><tt>expr</tt></i>:</span></td>
429<td>a compiled expression</td>
430</tr>
431<tr>
432<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
433<td>the maximum length or -1 in case of error</td>
434</tr>
435</tbody>
436</table></div>
437</div>
438<hr>
439<div class="refsect2" lang="en">
440<h3>
441<a name="xmlExpNewAtom"></a>xmlExpNewAtom ()</h3>
442<pre class="programlisting"><a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a>	xmlExpNewAtom		(<a href="libxml2-xmlregexp.html#xmlExpCtxtPtr">xmlExpCtxtPtr</a> ctxt, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * name, <br>					 int len)<br>
443</pre>
444<p>Get the atom associated to this name from that context</p>
445<div class="variablelist"><table border="0">
446<col align="left">
447<tbody>
448<tr>
449<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
450<td>the expression context</td>
451</tr>
452<tr>
453<td><span class="term"><i><tt>name</tt></i>:</span></td>
454<td>the atom name</td>
455</tr>
456<tr>
457<td><span class="term"><i><tt>len</tt></i>:</span></td>
458<td>the atom name length in byte (or -1);</td>
459</tr>
460<tr>
461<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
462<td>the node or NULL in case of error</td>
463</tr>
464</tbody>
465</table></div>
466</div>
467<hr>
468<div class="refsect2" lang="en">
469<h3>
470<a name="xmlExpNewCtxt"></a>xmlExpNewCtxt ()</h3>
471<pre class="programlisting"><a href="libxml2-xmlregexp.html#xmlExpCtxtPtr">xmlExpCtxtPtr</a>	xmlExpNewCtxt		(int maxNodes, <br>					 <a href="libxml2-dict.html#xmlDictPtr">xmlDictPtr</a> dict)<br>
472</pre>
473<p>Creates a new context for manipulating expressions</p>
474<div class="variablelist"><table border="0">
475<col align="left">
476<tbody>
477<tr>
478<td><span class="term"><i><tt>maxNodes</tt></i>:</span></td>
479<td>the maximum number of nodes</td>
480</tr>
481<tr>
482<td><span class="term"><i><tt>dict</tt></i>:</span></td>
483<td>optional dictionary to use internally</td>
484</tr>
485<tr>
486<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
487<td>the context or NULL in case of error</td>
488</tr>
489</tbody>
490</table></div>
491</div>
492<hr>
493<div class="refsect2" lang="en">
494<h3>
495<a name="xmlExpNewOr"></a>xmlExpNewOr ()</h3>
496<pre class="programlisting"><a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a>	xmlExpNewOr		(<a href="libxml2-xmlregexp.html#xmlExpCtxtPtr">xmlExpCtxtPtr</a> ctxt, <br>					 <a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a> left, <br>					 <a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a> right)<br>
497</pre>
498<p>Get the atom associated to the choice @left | @right Note that @left and @right are consumed in the operation, to keep an handle on them use xmlExpRef() and use xmlExpFree() to release them, this is true even in case of failure (unless ctxt == NULL).</p>
499<div class="variablelist"><table border="0">
500<col align="left">
501<tbody>
502<tr>
503<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
504<td>the expression context</td>
505</tr>
506<tr>
507<td><span class="term"><i><tt>left</tt></i>:</span></td>
508<td>left expression</td>
509</tr>
510<tr>
511<td><span class="term"><i><tt>right</tt></i>:</span></td>
512<td>right expression</td>
513</tr>
514<tr>
515<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
516<td>the node or NULL in case of error</td>
517</tr>
518</tbody>
519</table></div>
520</div>
521<hr>
522<div class="refsect2" lang="en">
523<h3>
524<a name="xmlExpNewRange"></a>xmlExpNewRange ()</h3>
525<pre class="programlisting"><a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a>	xmlExpNewRange		(<a href="libxml2-xmlregexp.html#xmlExpCtxtPtr">xmlExpCtxtPtr</a> ctxt, <br>					 <a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a> subset, <br>					 int min, <br>					 int max)<br>
526</pre>
527<p>Get the atom associated to the range (@subset){@min, @max} Note that @subset is consumed in the operation, to keep an handle on it use xmlExpRef() and use xmlExpFree() to release it, this is true even in case of failure (unless ctxt == NULL).</p>
528<div class="variablelist"><table border="0">
529<col align="left">
530<tbody>
531<tr>
532<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
533<td>the expression context</td>
534</tr>
535<tr>
536<td><span class="term"><i><tt>subset</tt></i>:</span></td>
537<td>the expression to be repeated</td>
538</tr>
539<tr>
540<td><span class="term"><i><tt>min</tt></i>:</span></td>
541<td>the lower bound for the repetition</td>
542</tr>
543<tr>
544<td><span class="term"><i><tt>max</tt></i>:</span></td>
545<td>the upper bound for the repetition, -1 means infinite</td>
546</tr>
547<tr>
548<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
549<td>the node or NULL in case of error</td>
550</tr>
551</tbody>
552</table></div>
553</div>
554<hr>
555<div class="refsect2" lang="en">
556<h3>
557<a name="xmlExpNewSeq"></a>xmlExpNewSeq ()</h3>
558<pre class="programlisting"><a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a>	xmlExpNewSeq		(<a href="libxml2-xmlregexp.html#xmlExpCtxtPtr">xmlExpCtxtPtr</a> ctxt, <br>					 <a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a> left, <br>					 <a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a> right)<br>
559</pre>
560<p>Get the atom associated to the sequence @left , @right Note that @left and @right are consumed in the operation, to keep an handle on them use xmlExpRef() and use xmlExpFree() to release them, this is true even in case of failure (unless ctxt == NULL).</p>
561<div class="variablelist"><table border="0">
562<col align="left">
563<tbody>
564<tr>
565<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
566<td>the expression context</td>
567</tr>
568<tr>
569<td><span class="term"><i><tt>left</tt></i>:</span></td>
570<td>left expression</td>
571</tr>
572<tr>
573<td><span class="term"><i><tt>right</tt></i>:</span></td>
574<td>right expression</td>
575</tr>
576<tr>
577<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
578<td>the node or NULL in case of error</td>
579</tr>
580</tbody>
581</table></div>
582</div>
583<hr>
584<div class="refsect2" lang="en">
585<h3>
586<a name="xmlExpParse"></a>xmlExpParse ()</h3>
587<pre class="programlisting"><a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a>	xmlExpParse		(<a href="libxml2-xmlregexp.html#xmlExpCtxtPtr">xmlExpCtxtPtr</a> ctxt, <br>					 const char * expr)<br>
588</pre>
589<p>Minimal parser for regexps, it understand the following constructs - string terminals - choice operator | - sequence operator , - subexpressions (...) - usual cardinality operators + * and ? - finite sequences { min, max } - infinite sequences { min, * } There is minimal checkings made especially no checking on strings values</p>
590<div class="variablelist"><table border="0">
591<col align="left">
592<tbody>
593<tr>
594<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
595<td>the expressions context</td>
596</tr>
597<tr>
598<td><span class="term"><i><tt>expr</tt></i>:</span></td>
599<td>the 0 terminated string</td>
600</tr>
601<tr>
602<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
603<td>a new expression or NULL in case of failure</td>
604</tr>
605</tbody>
606</table></div>
607</div>
608<hr>
609<div class="refsect2" lang="en">
610<h3>
611<a name="xmlExpRef"></a>xmlExpRef ()</h3>
612<pre class="programlisting">void	xmlExpRef			(<a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a> exp)<br>
613</pre>
614<p>Increase the <a href="libxml2-SAX.html#reference">reference</a> count of the expression</p>
615<div class="variablelist"><table border="0">
616<col align="left">
617<tbody><tr>
618<td><span class="term"><i><tt>exp</tt></i>:</span></td>
619<td>the expression</td>
620</tr></tbody>
621</table></div>
622</div>
623<hr>
624<div class="refsect2" lang="en">
625<h3>
626<a name="xmlExpStringDerive"></a>xmlExpStringDerive ()</h3>
627<pre class="programlisting"><a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a>	xmlExpStringDerive	(<a href="libxml2-xmlregexp.html#xmlExpCtxtPtr">xmlExpCtxtPtr</a> ctxt, <br>					 <a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a> exp, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * str, <br>					 int len)<br>
628</pre>
629<p>Do one step of Brzozowski derivation of the expression @exp with respect to the input string</p>
630<div class="variablelist"><table border="0">
631<col align="left">
632<tbody>
633<tr>
634<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
635<td>the expression context</td>
636</tr>
637<tr>
638<td><span class="term"><i><tt>exp</tt></i>:</span></td>
639<td>the expression</td>
640</tr>
641<tr>
642<td><span class="term"><i><tt>str</tt></i>:</span></td>
643<td>the string</td>
644</tr>
645<tr>
646<td><span class="term"><i><tt>len</tt></i>:</span></td>
647<td>the string len in bytes if available</td>
648</tr>
649<tr>
650<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
651<td>the resulting expression or NULL in case of internal error</td>
652</tr>
653</tbody>
654</table></div>
655</div>
656<hr>
657<div class="refsect2" lang="en">
658<h3>
659<a name="xmlExpSubsume"></a>xmlExpSubsume ()</h3>
660<pre class="programlisting">int	xmlExpSubsume			(<a href="libxml2-xmlregexp.html#xmlExpCtxtPtr">xmlExpCtxtPtr</a> ctxt, <br>					 <a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a> exp, <br>					 <a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a> sub)<br>
661</pre>
662<p>Check whether @exp accepts all the languages accepted by @sub the input being a subexpression.</p>
663<div class="variablelist"><table border="0">
664<col align="left">
665<tbody>
666<tr>
667<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
668<td>the expressions context</td>
669</tr>
670<tr>
671<td><span class="term"><i><tt>exp</tt></i>:</span></td>
672<td>the englobing expression</td>
673</tr>
674<tr>
675<td><span class="term"><i><tt>sub</tt></i>:</span></td>
676<td>the subexpression</td>
677</tr>
678<tr>
679<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
680<td>1 if true 0 if false and -1 in case of failure.</td>
681</tr>
682</tbody>
683</table></div>
684</div>
685<hr>
686<div class="refsect2" lang="en">
687<h3>
688<a name="xmlRegExecErrInfo"></a>xmlRegExecErrInfo ()</h3>
689<pre class="programlisting">int	xmlRegExecErrInfo		(<a href="libxml2-xmlregexp.html#xmlRegExecCtxtPtr">xmlRegExecCtxtPtr</a> exec, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> ** string, <br>					 int * nbval, <br>					 int * nbneg, <br>					 <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> ** values, <br>					 int * terminal)<br>
690</pre>
691<p>Extract error information from the regexp execution, the parameter @string will be updated with the value pushed and not accepted, the parameter @values must point to an array of @nbval string pointers on return nbval will contain the number of possible strings in that state and the @values array will be updated with them. The string values</p>
692<div class="variablelist"><table border="0">
693<col align="left">
694<tbody>
695<tr>
696<td><span class="term"><i><tt>exec</tt></i>:</span></td>
697<td>a regexp execution context generating an error</td>
698</tr>
699<tr>
700<td><span class="term"><i><tt>string</tt></i>:</span></td>
701<td>return value for the error string</td>
702</tr>
703<tr>
704<td><span class="term"><i><tt>nbval</tt></i>:</span></td>
705<td>pointer to the number of accepted values IN/OUT</td>
706</tr>
707<tr>
708<td><span class="term"><i><tt>nbneg</tt></i>:</span></td>
709<td>return number of negative transitions</td>
710</tr>
711<tr>
712<td><span class="term"><i><tt>values</tt></i>:</span></td>
713<td>pointer to the array of acceptable values</td>
714</tr>
715<tr>
716<td><span class="term"><i><tt>terminal</tt></i>:</span></td>
717<td>return value if this was a terminal state</td>
718</tr>
719<tr>
720<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
721<td>will be freed with the @exec context and don't need to be deallocated. Returns: 0 in case of success or -1 in case of error.</td>
722</tr>
723</tbody>
724</table></div>
725</div>
726<hr>
727<div class="refsect2" lang="en">
728<h3>
729<a name="xmlRegExecNextValues"></a>xmlRegExecNextValues ()</h3>
730<pre class="programlisting">int	xmlRegExecNextValues		(<a href="libxml2-xmlregexp.html#xmlRegExecCtxtPtr">xmlRegExecCtxtPtr</a> exec, <br>					 int * nbval, <br>					 int * nbneg, <br>					 <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> ** values, <br>					 int * terminal)<br>
731</pre>
732<p>Extract information from the regexp execution, the parameter @values must point to an array of @nbval string pointers on return nbval will contain the number of possible strings in that state and the @values array will be updated with them. The string values</p>
733<div class="variablelist"><table border="0">
734<col align="left">
735<tbody>
736<tr>
737<td><span class="term"><i><tt>exec</tt></i>:</span></td>
738<td>a regexp execution context</td>
739</tr>
740<tr>
741<td><span class="term"><i><tt>nbval</tt></i>:</span></td>
742<td>pointer to the number of accepted values IN/OUT</td>
743</tr>
744<tr>
745<td><span class="term"><i><tt>nbneg</tt></i>:</span></td>
746<td>return number of negative transitions</td>
747</tr>
748<tr>
749<td><span class="term"><i><tt>values</tt></i>:</span></td>
750<td>pointer to the array of acceptable values</td>
751</tr>
752<tr>
753<td><span class="term"><i><tt>terminal</tt></i>:</span></td>
754<td>return value if this was a terminal state</td>
755</tr>
756<tr>
757<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
758<td>will be freed with the @exec context and don't need to be deallocated. Returns: 0 in case of success or -1 in case of error.</td>
759</tr>
760</tbody>
761</table></div>
762</div>
763<hr>
764<div class="refsect2" lang="en">
765<h3>
766<a name="xmlRegExecPushString"></a>xmlRegExecPushString ()</h3>
767<pre class="programlisting">int	xmlRegExecPushString		(<a href="libxml2-xmlregexp.html#xmlRegExecCtxtPtr">xmlRegExecCtxtPtr</a> exec, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * value, <br>					 void * data)<br>
768</pre>
769<p>Push one input token in the execution context</p>
770<div class="variablelist"><table border="0">
771<col align="left">
772<tbody>
773<tr>
774<td><span class="term"><i><tt>exec</tt></i>:</span></td>
775<td>a regexp execution context or NULL to indicate the end</td>
776</tr>
777<tr>
778<td><span class="term"><i><tt>value</tt></i>:</span></td>
779<td>a string token input</td>
780</tr>
781<tr>
782<td><span class="term"><i><tt>data</tt></i>:</span></td>
783<td>data associated to the token to reuse in callbacks</td>
784</tr>
785<tr>
786<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
787<td>1 if the regexp reached a final state, 0 if non-final, and a negative value in case of error.</td>
788</tr>
789</tbody>
790</table></div>
791</div>
792<hr>
793<div class="refsect2" lang="en">
794<h3>
795<a name="xmlRegExecPushString2"></a>xmlRegExecPushString2 ()</h3>
796<pre class="programlisting">int	xmlRegExecPushString2		(<a href="libxml2-xmlregexp.html#xmlRegExecCtxtPtr">xmlRegExecCtxtPtr</a> exec, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * value, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * value2, <br>					 void * data)<br>
797</pre>
798<p>Push one input token in the execution context</p>
799<div class="variablelist"><table border="0">
800<col align="left">
801<tbody>
802<tr>
803<td><span class="term"><i><tt>exec</tt></i>:</span></td>
804<td>a regexp execution context or NULL to indicate the end</td>
805</tr>
806<tr>
807<td><span class="term"><i><tt>value</tt></i>:</span></td>
808<td>the first string token input</td>
809</tr>
810<tr>
811<td><span class="term"><i><tt>value2</tt></i>:</span></td>
812<td>the second string token input</td>
813</tr>
814<tr>
815<td><span class="term"><i><tt>data</tt></i>:</span></td>
816<td>data associated to the token to reuse in callbacks</td>
817</tr>
818<tr>
819<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
820<td>1 if the regexp reached a final state, 0 if non-final, and a negative value in case of error.</td>
821</tr>
822</tbody>
823</table></div>
824</div>
825<hr>
826<div class="refsect2" lang="en">
827<h3>
828<a name="xmlRegFreeExecCtxt"></a>xmlRegFreeExecCtxt ()</h3>
829<pre class="programlisting">void	xmlRegFreeExecCtxt		(<a href="libxml2-xmlregexp.html#xmlRegExecCtxtPtr">xmlRegExecCtxtPtr</a> exec)<br>
830</pre>
831<p>Free the structures associated to a regular expression evaluation context.</p>
832<div class="variablelist"><table border="0">
833<col align="left">
834<tbody><tr>
835<td><span class="term"><i><tt>exec</tt></i>:</span></td>
836<td>a regular expression evaluation context</td>
837</tr></tbody>
838</table></div>
839</div>
840<hr>
841<div class="refsect2" lang="en">
842<h3>
843<a name="xmlRegFreeRegexp"></a>xmlRegFreeRegexp ()</h3>
844<pre class="programlisting">void	xmlRegFreeRegexp		(<a href="libxml2-xmlregexp.html#xmlRegexpPtr">xmlRegexpPtr</a> regexp)<br>
845</pre>
846<p>Free a regexp</p>
847<div class="variablelist"><table border="0">
848<col align="left">
849<tbody><tr>
850<td><span class="term"><i><tt>regexp</tt></i>:</span></td>
851<td>the regexp</td>
852</tr></tbody>
853</table></div>
854</div>
855<hr>
856<div class="refsect2" lang="en">
857<h3>
858<a name="xmlRegNewExecCtxt"></a>xmlRegNewExecCtxt ()</h3>
859<pre class="programlisting"><a href="libxml2-xmlregexp.html#xmlRegExecCtxtPtr">xmlRegExecCtxtPtr</a>	xmlRegNewExecCtxt	(<a href="libxml2-xmlregexp.html#xmlRegexpPtr">xmlRegexpPtr</a> comp, <br>						 <a href="libxml2-xmlregexp.html#xmlRegExecCallbacks">xmlRegExecCallbacks</a> callback, <br>						 void * data)<br>
860</pre>
861<p>Build a context used for progressive evaluation of a regexp.</p>
862<div class="variablelist"><table border="0">
863<col align="left">
864<tbody>
865<tr>
866<td><span class="term"><i><tt>comp</tt></i>:</span></td>
867<td>a precompiled regular expression</td>
868</tr>
869<tr>
870<td><span class="term"><i><tt>callback</tt></i>:</span></td>
871<td>a callback function used for handling progresses in the automata matching phase</td>
872</tr>
873<tr>
874<td><span class="term"><i><tt>data</tt></i>:</span></td>
875<td>the context data associated to the callback in this context</td>
876</tr>
877<tr>
878<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
879<td>the new context</td>
880</tr>
881</tbody>
882</table></div>
883</div>
884<hr>
885<div class="refsect2" lang="en">
886<h3>
887<a name="xmlRegexpCompile"></a>xmlRegexpCompile ()</h3>
888<pre class="programlisting"><a href="libxml2-xmlregexp.html#xmlRegexpPtr">xmlRegexpPtr</a>	xmlRegexpCompile	(const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * regexp)<br>
889</pre>
890<p>Parses a regular expression conforming to XML Schemas Part 2 Datatype Appendix F and builds an automata suitable for testing strings against that regular expression</p>
891<div class="variablelist"><table border="0">
892<col align="left">
893<tbody>
894<tr>
895<td><span class="term"><i><tt>regexp</tt></i>:</span></td>
896<td>a regular expression string</td>
897</tr>
898<tr>
899<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
900<td>the compiled expression or NULL in case of error</td>
901</tr>
902</tbody>
903</table></div>
904</div>
905<hr>
906<div class="refsect2" lang="en">
907<h3>
908<a name="xmlRegexpExec"></a>xmlRegexpExec ()</h3>
909<pre class="programlisting">int	xmlRegexpExec			(<a href="libxml2-xmlregexp.html#xmlRegexpPtr">xmlRegexpPtr</a> comp, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * content)<br>
910</pre>
911<p>Check if the regular expression generates the value</p>
912<div class="variablelist"><table border="0">
913<col align="left">
914<tbody>
915<tr>
916<td><span class="term"><i><tt>comp</tt></i>:</span></td>
917<td>the compiled regular expression</td>
918</tr>
919<tr>
920<td><span class="term"><i><tt>content</tt></i>:</span></td>
921<td>the value to check against the regular expression</td>
922</tr>
923<tr>
924<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
925<td>1 if it matches, 0 if not and a negative value in case of error</td>
926</tr>
927</tbody>
928</table></div>
929</div>
930<hr>
931<div class="refsect2" lang="en">
932<h3>
933<a name="xmlRegexpIsDeterminist"></a>xmlRegexpIsDeterminist ()</h3>
934<pre class="programlisting">int	xmlRegexpIsDeterminist		(<a href="libxml2-xmlregexp.html#xmlRegexpPtr">xmlRegexpPtr</a> comp)<br>
935</pre>
936<p>Check if the regular expression is determinist</p>
937<div class="variablelist"><table border="0">
938<col align="left">
939<tbody>
940<tr>
941<td><span class="term"><i><tt>comp</tt></i>:</span></td>
942<td>the compiled regular expression</td>
943</tr>
944<tr>
945<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
946<td>1 if it yes, 0 if not and a negative value in case of error</td>
947</tr>
948</tbody>
949</table></div>
950</div>
951<hr>
952<div class="refsect2" lang="en">
953<h3>
954<a name="xmlRegexpPrint"></a>xmlRegexpPrint ()</h3>
955<pre class="programlisting">void	xmlRegexpPrint			(FILE * output, <br>					 <a href="libxml2-xmlregexp.html#xmlRegexpPtr">xmlRegexpPtr</a> regexp)<br>
956</pre>
957<p>Print the content of the compiled regular expression</p>
958<div class="variablelist"><table border="0">
959<col align="left">
960<tbody>
961<tr>
962<td><span class="term"><i><tt>output</tt></i>:</span></td>
963<td>the file for the output debug</td>
964</tr>
965<tr>
966<td><span class="term"><i><tt>regexp</tt></i>:</span></td>
967<td>the compiled regexp</td>
968</tr>
969</tbody>
970</table></div>
971</div>
972<hr>
973</div>
974</div>
975</body>
976</html>
977