<refentry id="streamtuner-st-re-api">
<refmeta>
<refentrytitle>st-re</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>STREAMTUNER Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>st-re</refname><refpurpose>functions for matching regular expressions.</refpurpose>
</refnamediv>

<refsynopsisdiv><title>Synopsis</title>

<synopsis>



#define     <link linkend="st-re-match">st_re_match</link>                     (regexp, str)
<link linkend="gboolean">gboolean</link>    <link linkend="st-re-parse">st_re_parse</link>                     (const <link linkend="regex-t">regex_t</link> *regexp,
                                             const <link linkend="char">char</link> *str,
                                             ...);
</synopsis>
</refsynopsisdiv>









<refsect1>
<title>Description</title>
<para>

</para>
</refsect1>

<refsect1>
<title>Details</title>
<refsect2>
<title><anchor id="st-re-match"/>st_re_match()</title>
<indexterm><primary>st_re_match</primary></indexterm><programlisting>#define     st_re_match(regexp, str)</programlisting>
<para>
Evaluates to <literal>TRUE</literal> if <parameter>str</parameter> matches <parameter>regexp</parameter>.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>regexp</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="regex-t"><type>regex_t</type></link> to match.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>str</parameter>&nbsp;:</term>
<listitem><simpara> a string to match <parameter>regexp</parameter> against.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="st-re-parse"/>st_re_parse ()</title>
<indexterm><primary>st_re_parse</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>    st_re_parse                     (const <link linkend="regex-t">regex_t</link> *regexp,
                                             const <link linkend="char">char</link> *str,
                                             ...);</programlisting>
<para>
Checks if <parameter>str</parameter> matches <parameter>regexp</parameter>, and if it does, distributes the
substrings of <parameter>str</parameter> matched by the parenthesized subexpressions of
<parameter>regexp</parameter>.
</para>
<para>
<informalexample><programlisting>
int status;
regex_t re;
gboolean matches;
char *value1, *value2;
&nbsp;
status = regcomp(&amp;re, "name1=(.*) name2=(.*)", REG_EXTENDED);
g_assert(status == 0);
&nbsp;
matches = st_re_parse(&amp;re, "name1=foo name2=bar", &amp;value1, &amp;value2);
</programlisting></informalexample></para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>regexp</parameter>&nbsp;:</term>
<listitem><simpara> a regular expression to match.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>str</parameter>&nbsp;:</term>
<listitem><simpara> a string to match <parameter>regexp</parameter> against.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>...</parameter>&nbsp;:</term>
<listitem><simpara> a list of char ** pointers for storing substrings of
<parameter>str</parameter>. The number of char ** pointers provided must be equal to
<parameter>regexp->re_nsub</parameter>. The strings stored in the pointers should be freed
when no longer needed.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> <literal>TRUE</literal> if <parameter>str</parameter> matches <parameter>regexp</parameter>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>

</refsect1>




</refentry>
