2010-09-04 21:33:53 +02:00
\hypertarget { group_ _ regex} {
\section { Regex management}
\label { group_ _ regex} \index { Regex management@{ Regex management} }
}
\subsection * { Functions}
\begin { DoxyCompactItemize}
\item
int \hyperlink { group_ _ regex_ ga35f57c052a7de1ded54b67a1f7819791} { preg\_ \- match} (const char $ \ast $ expr, char $ \ast $ str, char $ \ast $ $ \ast $ $ \ast $ matches, int $ \ast $ nmatches)
2010-09-11 12:45:30 +02:00
\begin { DoxyCompactList} \small \item \em Check if a string matches a regular expression. \item \end { DoxyCompactList} \item
char $ \ast $ \hyperlink { group_ _ regex_ ga736ba1abdc4938cbb1bf5861e7dbfd50} { str\_ \- replace} (char $ \ast $ str, char $ \ast $ orig, char $ \ast $ rep)
\begin { DoxyCompactList} \small \item \em Replace the content of 'orig' in 'str' with 'rep'. \item \end { DoxyCompactList} \item
char $ \ast $ \hyperlink { group_ _ regex_ gaff6c55cd04fc08dd582e244590dc25a4} { str\_ \- replace\_ \- all} (char $ \ast $ str, char $ \ast $ orig, char $ \ast $ rep)
\begin { DoxyCompactList} \small \item \em Replace all of the occurrences of 'orig' in 'str' with 'rep'. \item \end { DoxyCompactList} \end { DoxyCompactItemize}
2010-09-04 21:33:53 +02:00
\subsection { Function Documentation}
\hypertarget { group_ _ regex_ ga35f57c052a7de1ded54b67a1f7819791} {
\index { regex@{ regex} !preg\_ \- match@{ preg\_ \- match} }
\index { preg\_ \- match@{ preg\_ \- match} !regex@{ regex} }
\subsubsection [{preg\_\-match}] { \setlength { \rightskip } { 0pt plus 5cm} int preg\_ \- match (
\begin { DoxyParamCaption}
\item [{const char $\ast$}] { expr, }
\item [{char $\ast$}] { str, }
\item [{char $\ast$$\ast$$\ast$}] { matches, }
\item [{int $\ast$}] { nmatches}
\end { DoxyParamCaption}
)} }
\label { group_ _ regex_ ga35f57c052a7de1ded54b67a1f7819791}
Check if a string matches a regular expression.
\begin { DoxyParams} { Parameters}
\item [{\em expr}] Regular expression to be matched \item [{\em str}] String to be checked \item [{\em matches}] Reference to a char$ \ast $ $ \ast $ that will contain the submatches (NULL if you don't need it) \item [{\em nmatches}] Reference to a int containing the number of submatches found (NULL if you don't need it) \end { DoxyParams}
\begin { DoxyReturn} { Returns}
-\/ 1 if the regex is wrong, 0 if no match was found, 1 otherwise
\end { DoxyReturn}
2010-09-11 12:45:30 +02:00
\hypertarget { group_ _ regex_ ga736ba1abdc4938cbb1bf5861e7dbfd50} {
\index { regex@{ regex} !str\_ \- replace@{ str\_ \- replace} }
\index { str\_ \- replace@{ str\_ \- replace} !regex@{ regex} }
\subsubsection [{str\_\-replace}] { \setlength { \rightskip } { 0pt plus 5cm} char$ \ast $ str\_ \- replace (
\begin { DoxyParamCaption}
\item [{char $\ast$}] { str, }
\item [{char $\ast$}] { orig, }
\item [{char $\ast$}] { rep}
\end { DoxyParamCaption}
)} }
\label { group_ _ regex_ ga736ba1abdc4938cbb1bf5861e7dbfd50}
Replace the content of 'orig' in 'str' with 'rep'.
\begin { DoxyParams} { Parameters}
\item [{\em str}] String to work on \item [{\em orig}] String to be replaced \item [{\em rep}] Replacement for 'orig' \end { DoxyParams}
\begin { DoxyReturn} { Returns}
The string with the replacement
\end { DoxyReturn}
\hypertarget { group_ _ regex_ gaff6c55cd04fc08dd582e244590dc25a4} {
\index { regex@{ regex} !str\_ \- replace\_ \- all@{ str\_ \- replace\_ \- all} }
\index { str\_ \- replace\_ \- all@{ str\_ \- replace\_ \- all} !regex@{ regex} }
\subsubsection [{str\_\-replace\_\-all}] { \setlength { \rightskip } { 0pt plus 5cm} char$ \ast $ str\_ \- replace\_ \- all (
\begin { DoxyParamCaption}
\item [{char $\ast$}] { str, }
\item [{char $\ast$}] { orig, }
\item [{char $\ast$}] { rep}
\end { DoxyParamCaption}
)} }
\label { group_ _ regex_ gaff6c55cd04fc08dd582e244590dc25a4}
Replace all of the occurrences of 'orig' in 'str' with 'rep'.
\begin { DoxyParams} { Parameters}
\item [{\em str}] String to work on \item [{\em orig}] String to be replaced \item [{\em rep}] Replacement for 'orig' \end { DoxyParams}
\begin { DoxyReturn} { Returns}
The string with the replacement
\end { DoxyReturn}