mirror of
https://github.com/boostorg/regex.git
synced 2025-07-25 18:17:27 +02:00
Tweeked regex version number to reference <boost/version.hpp>
[SVN r11309]
This commit is contained in:
34
appendix.htm
34
appendix.htm
@ -13,25 +13,25 @@ content="C:\PROGRAM FILES\MICROSOFT OFFICE\OFFICE\html.dot">
|
||||
|
||||
<p> </p>
|
||||
|
||||
<table border="0" cellpadding="7" cellspacing="0" width="624">
|
||||
<table border="0" cellpadding="7" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td valign="top" width="50%"><h3><img
|
||||
src="../../c++boost.gif" alt="C++ Boost" width="276"
|
||||
height="86"></h3>
|
||||
<td valign="top"><h3><img src="../../c++boost.gif"
|
||||
alt="C++ Boost" width="276" height="86"></h3>
|
||||
</td>
|
||||
<td valign="top" width="50%"><h3 align="center">Regex++,
|
||||
Appendices.</h3>
|
||||
<p align="center"><i>(version 3.12, 18 April 2000)</i> </p>
|
||||
<pre><i>Copyright (c) 1998-2000
|
||||
Dr John Maddock
|
||||
|
||||
Permission to use, copy, modify, distribute and sell this software
|
||||
and its documentation for any purpose is hereby granted without fee,
|
||||
provided that the above copyright notice appear in all copies and
|
||||
that both that copyright notice and this permission notice appear
|
||||
in supporting documentation. Dr John Maddock makes no representations
|
||||
about the suitability of this software for any purpose.
|
||||
It is provided "as is" without express or implied warranty.</i></pre>
|
||||
<td valign="top"><h3 align="center">Regex++, Appendices.</h3>
|
||||
<p align="left"><i>(Version 3.20, 29th Sept 2001)</i>
|
||||
</p>
|
||||
<p align="left"><i>Copyright (c) 1998-2001 </i></p>
|
||||
<p align="left"><i>Dr John Maddock</i></p>
|
||||
<p align="left"><i>Permission to use, copy, modify,
|
||||
distribute and sell this software and its documentation
|
||||
for any purpose is hereby granted without fee, provided
|
||||
that the above copyright notice appear in all copies and
|
||||
that both that copyright notice and this permission
|
||||
notice appear in supporting documentation. Dr John
|
||||
Maddock makes no representations about the suitability of
|
||||
this software for any purpose. It is provided "as is"
|
||||
without express or implied warranty.</i></p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
@ -15,7 +15,7 @@
|
||||
|
||||
/*
|
||||
* FILE jgrep.cpp
|
||||
* VERSION 3.12
|
||||
* VERSION see <boost/version.hpp>
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
@ -15,7 +15,7 @@
|
||||
|
||||
/*
|
||||
* FILE jgrep.h
|
||||
* VERSION 3.12
|
||||
* VERSION see <boost/version.hpp>
|
||||
*/
|
||||
|
||||
#ifndef _JGREP_H
|
||||
|
@ -15,7 +15,7 @@
|
||||
|
||||
/*
|
||||
* FILE main.cpp
|
||||
* VERSION 3.12
|
||||
* VERSION see <boost/version.hpp>
|
||||
*/
|
||||
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
/*
|
||||
* LOCATION: see http://www.boost.org for most recent version.
|
||||
* FILE credit_card_example.cpp
|
||||
* VERSION 3.00
|
||||
* VERSION see <boost/version.hpp>
|
||||
* DESCRIPTION: Credit card number formatting code.
|
||||
*/
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
/*
|
||||
* LOCATION: see http://www.boost.org for most recent version.
|
||||
* FILE regex_grep_example_1.cpp
|
||||
* VERSION 3.00
|
||||
* VERSION see <boost/version.hpp>
|
||||
* DESCRIPTION: regex_grep example 1: searches a cpp file for class definitions.
|
||||
*/
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
/*
|
||||
* LOCATION: see http://www.boost.org for most recent version.
|
||||
* FILE regex_grep_example_2.cpp
|
||||
* VERSION 3.00
|
||||
* VERSION see <boost/version.hpp>
|
||||
* DESCRIPTION: regex_grep example 2: searches a cpp file for class definitions,
|
||||
* using a global callback function.
|
||||
*/
|
||||
|
@ -16,7 +16,7 @@
|
||||
/*
|
||||
* LOCATION: see http://www.boost.org for most recent version.
|
||||
* FILE regex_grep_example_3.cpp
|
||||
* VERSION 3.00
|
||||
* VERSION see <boost/version.hpp>
|
||||
* DESCRIPTION: regex_grep example 3: searches a cpp file for class definitions,
|
||||
* using a bound member function callback.
|
||||
*/
|
||||
|
@ -16,7 +16,7 @@
|
||||
/*
|
||||
* LOCATION: see http://www.boost.org for most recent version.
|
||||
* FILE regex_grep_example_4.cpp
|
||||
* VERSION 3.00
|
||||
* VERSION see <boost/version.hpp>
|
||||
* DESCRIPTION: regex_grep example 4: searches a cpp file for class definitions,
|
||||
* using a C++ Builder closure as a callback.
|
||||
*/
|
||||
|
@ -16,7 +16,7 @@
|
||||
/*
|
||||
* LOCATION: see http://www.boost.org for most recent version.
|
||||
* FILE regex_match_example.cpp
|
||||
* VERSION 3.00
|
||||
* VERSION see <boost/version.hpp>
|
||||
* DESCRIPTION: ftp based regex_match example.
|
||||
*/
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
/*
|
||||
* LOCATION: see http://www.boost.org for most recent version.
|
||||
* FILE regex_merge_example.cpp
|
||||
* VERSION 3.00
|
||||
* VERSION see <boost/version.hpp>
|
||||
* DESCRIPTION: regex_merge example:
|
||||
* converts a C++ file to syntax highlighted HTML.
|
||||
*/
|
||||
|
@ -16,7 +16,7 @@
|
||||
/*
|
||||
* LOCATION: see http://www.boost.org for most recent version.
|
||||
* FILE regex_search_example.cpp
|
||||
* VERSION 3.00
|
||||
* VERSION see <boost/version.hpp>
|
||||
* DESCRIPTION: regex_search example: searches a cpp file for class definitions.
|
||||
*/
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
/*
|
||||
* LOCATION: see http://www.boost.org for most recent version.
|
||||
* FILE regex_split_example_1.cpp
|
||||
* VERSION 3.00
|
||||
* VERSION see <boost/version.hpp>
|
||||
* DESCRIPTION: regex_split example: split a string into tokens.
|
||||
*/
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
/*
|
||||
* LOCATION: see http://www.boost.org for most recent version.
|
||||
* FILE regex_split_example_2.cpp
|
||||
* VERSION 3.00
|
||||
* VERSION see <boost/version.hpp>
|
||||
* DESCRIPTION: regex_split example: spit out linked URL's.
|
||||
*/
|
||||
|
||||
|
34
faq.htm
34
faq.htm
@ -13,25 +13,25 @@ content="C:\PROGRAM FILES\MICROSOFT OFFICE\OFFICE\html.dot">
|
||||
|
||||
<p> </p>
|
||||
|
||||
<table border="0" cellpadding="7" cellspacing="0" width="624">
|
||||
<table border="0" cellpadding="7" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td valign="top" width="50%"><h3><img
|
||||
src="../../c++boost.gif" alt="C++ Boost" width="276"
|
||||
height="86"></h3>
|
||||
<td valign="top"><h3><img src="../../c++boost.gif"
|
||||
alt="C++ Boost" width="276" height="86"></h3>
|
||||
</td>
|
||||
<td valign="top" width="50%"><h3 align="center">Regex++,
|
||||
FAQ.</h3>
|
||||
<p align="center"><i>(version 3.12, 18 April 2000)</i> </p>
|
||||
<pre><i>Copyright (c) 1998-2000
|
||||
Dr John Maddock
|
||||
|
||||
Permission to use, copy, modify, distribute and sell this software
|
||||
and its documentation for any purpose is hereby granted without fee,
|
||||
provided that the above copyright notice appear in all copies and
|
||||
that both that copyright notice and this permission notice appear
|
||||
in supporting documentation. Dr John Maddock makes no representations
|
||||
about the suitability of this software for any purpose.
|
||||
It is provided "as is" without express or implied warranty.</i></pre>
|
||||
<td valign="top"><h3 align="center">Regex++, FAQ.</h3>
|
||||
<p align="left"><i>(Version 3.20, 29th Sept 2001)</i>
|
||||
</p>
|
||||
<p align="left"><i>Copyright (c) 1998-2001 </i></p>
|
||||
<p align="left"><i>Dr John Maddock</i></p>
|
||||
<p align="left"><i>Permission to use, copy, modify,
|
||||
distribute and sell this software and its documentation
|
||||
for any purpose is hereby granted without fee, provided
|
||||
that the above copyright notice appear in all copies and
|
||||
that both that copyright notice and this permission
|
||||
notice appear in supporting documentation. Dr John
|
||||
Maddock makes no representations about the suitability of
|
||||
this software for any purpose. It is provided "as is"
|
||||
without express or implied warranty.</i></p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
@ -1,202 +1,245 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//w3c//dtd html 4.0 transitional//en">
|
||||
<html>
|
||||
|
||||
<HTML>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type"
|
||||
content="text/html; charset=iso-8859-1">
|
||||
<meta name="Template"
|
||||
content="C:\PROGRAM FILES\MICROSOFT OFFICE\OFFICE\html.dot">
|
||||
<meta name="GENERATOR" content="Microsoft FrontPage Express 2.0">
|
||||
<title>Regex++, Format String Reference</title>
|
||||
</head>
|
||||
|
||||
<HEAD>
|
||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
|
||||
<META NAME="Template"
|
||||
CONTENT="C:\PROGRAM FILES\MICROSOFT OFFICE\OFFICE\html.dot">
|
||||
<META NAME="GENERATOR" CONTENT="Mozilla/4.5 [en] (Win98; I) [Netscape]">
|
||||
<TITLE>Regex++, Format String Reference</TITLE>
|
||||
</HEAD>
|
||||
<body bgcolor="#FFFFFF" link="#0000FF" vlink="#800080">
|
||||
|
||||
<BODY BGCOLOR="#FFFFFF" LINK="#0000FF" VLINK="#800080">
|
||||
<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="7" WIDTH="100%">
|
||||
<TR>
|
||||
<TD VALIGN="TOP" WIDTH="50%"> <H3>
|
||||
<IMG SRC="../../c++boost.gif" HEIGHT="86" WIDTH="276" ALT="C++ Boost"></H3>
|
||||
</TD>
|
||||
<TD VALIGN="TOP" WIDTH="50%"> <CENTER>
|
||||
<H3> Regex++, Format String Reference.</H3>
|
||||
</CENTER>
|
||||
<CENTER>
|
||||
<I>(version 3.12, 18 April 2000)</I>
|
||||
</CENTER>
|
||||
<PRE><I>Copyright (c) 1998-2000
|
||||
Dr John Maddock
|
||||
<p> </p>
|
||||
|
||||
Permission to use, copy, modify, distribute and sell this software
|
||||
and its documentation for any purpose is hereby granted without fee,
|
||||
provided that the above copyright notice appear in all copies and
|
||||
that both that copyright notice and this permission notice appear
|
||||
in supporting documentation. Dr John Maddock makes no representations
|
||||
about the suitability of this software for any purpose.
|
||||
It is provided "as is" without express or implied warranty.</I></PRE>
|
||||
<table border="0" cellpadding="7" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td valign="top"><h3><img src="../../c++boost.gif"
|
||||
alt="C++ Boost" width="276" height="86"></h3>
|
||||
</td>
|
||||
<td valign="top"><h3 align="center">Regex++, Format
|
||||
String Reference.</h3>
|
||||
<p align="left"><i>(Version 3.20, 29th Sept 2001)</i>
|
||||
</p>
|
||||
<p align="left"><i>Copyright (c) 1998-2001 </i></p>
|
||||
<p align="left"><i>Dr John Maddock</i></p>
|
||||
<p align="left"><i>Permission to use, copy, modify,
|
||||
distribute and sell this software and its documentation
|
||||
for any purpose is hereby granted without fee, provided
|
||||
that the above copyright notice appear in all copies and
|
||||
that both that copyright notice and this permission
|
||||
notice appear in supporting documentation. Dr John
|
||||
Maddock makes no representations about the suitability of
|
||||
this software for any purpose. It is provided "as is"
|
||||
without express or implied warranty.</i></p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<HR>
|
||||
<H3> <A NAME="format_string"></A>Format String Syntax</H3>
|
||||
Format strings are used by the algorithms
|
||||
<A HREF="template_class_ref.htm#reg_format">regex_format</A> and
|
||||
<A HREF="template_class_ref.htm#reg_merge">regex_merge</A>, and are used to
|
||||
transform one string into another. <P>There are three kind of format string:
|
||||
sed, perl and extended, the extended syntax is the default so this is covered
|
||||
first. </P>
|
||||
<P><B><I>Extended format syntax</I></B> </P>
|
||||
<P>In format strings, all characters are treated as literals except: ()$\?:
|
||||
</P>
|
||||
<P>To use any of these as literals you must prefix them with the escape
|
||||
character \ </P>
|
||||
<P>The following special sequences are recognized: <BR>
|
||||
<BR>
|
||||
</P>
|
||||
<P><I>Grouping:</I> </P>
|
||||
<P>Use the parenthesis characters ( and ) to group sub-expressions within the
|
||||
format string, use \( and \) to represent literal '(' and ')'. <BR>
|
||||
<BR>
|
||||
</P>
|
||||
<P><I>Sub-expression expansions:</I> </P>
|
||||
<P>The following perl like expressions expand to a particular matched
|
||||
sub-expression: <BR>
|
||||
</P>
|
||||
<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="7" WIDTH="100%">
|
||||
<TR>
|
||||
<TD VALIGN="TOP" WIDTH="8%"> </TD>
|
||||
<TD VALIGN="TOP" WIDTH="40%">$`</TD>
|
||||
<TD VALIGN="TOP" WIDTH="43%">Expands to all the text from the end of the
|
||||
previous match to the start of the current match, if there was no previous
|
||||
match in the current operation, then everything from the start of the input
|
||||
string to the start of the match.</TD>
|
||||
<TD VALIGN="TOP" WIDTH="9%"> </TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD VALIGN="TOP" WIDTH="8%"> </TD>
|
||||
<TD VALIGN="TOP" WIDTH="40%">$'</TD>
|
||||
<TD VALIGN="TOP" WIDTH="43%">Expands to all the text from the end of the match
|
||||
to the end of the input string.</TD>
|
||||
<TD VALIGN="TOP" WIDTH="9%"> </TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD VALIGN="TOP" WIDTH="8%"> </TD>
|
||||
<TD VALIGN="TOP" WIDTH="40%">$&</TD>
|
||||
<TD VALIGN="TOP" WIDTH="43%">Expands to all of the current match.</TD>
|
||||
<TD VALIGN="TOP" WIDTH="9%"> </TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD VALIGN="TOP" WIDTH="8%"> </TD>
|
||||
<TD VALIGN="TOP" WIDTH="40%">$0</TD>
|
||||
<TD VALIGN="TOP" WIDTH="43%">Expands to all of the current match.</TD>
|
||||
<TD VALIGN="TOP" WIDTH="9%"> </TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD VALIGN="TOP" WIDTH="8%"> </TD>
|
||||
<TD VALIGN="TOP" WIDTH="40%">$N</TD>
|
||||
<TD VALIGN="TOP" WIDTH="43%">Expands to the text that matched sub-expression
|
||||
<I>N</I>.</TD>
|
||||
<TD VALIGN="TOP" WIDTH="9%"> </TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<BR>
|
||||
<P><I>Conditional expressions:</I> </P>
|
||||
<P>Conditional expressions allow two different format strings to be selected
|
||||
dependent upon whether a sub-expression participated in the match or not: </P>
|
||||
<P>?Ntrue_expression:false_expression </P>
|
||||
<P>Executes true_expression if sub-expression <I>N</I> participated in the
|
||||
match, otherwise executes false_expression. </P>
|
||||
<P>Example: suppose we search for "(while)|(for)" then the format
|
||||
string "?1WHILE:FOR" would output what matched, but in upper case.
|
||||
<BR>
|
||||
<BR>
|
||||
</P>
|
||||
<P><I>Escape sequences:</I> </P>
|
||||
<P>The following escape sequences are also allowed: <BR>
|
||||
</P>
|
||||
<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="7" WIDTH="100%">
|
||||
<TR>
|
||||
<TD VALIGN="TOP" WIDTH="8%"> </TD>
|
||||
<TD VALIGN="TOP" WIDTH="40%">\a</TD>
|
||||
<TD VALIGN="TOP" WIDTH="43%">The bell character.</TD>
|
||||
<TD VALIGN="TOP" WIDTH="9%"> </TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD VALIGN="TOP" WIDTH="8%"> </TD>
|
||||
<TD VALIGN="TOP" WIDTH="40%">\f</TD>
|
||||
<TD VALIGN="TOP" WIDTH="43%">The form feed character.</TD>
|
||||
<TD VALIGN="TOP" WIDTH="9%"> </TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD VALIGN="TOP" WIDTH="8%"> </TD>
|
||||
<TD VALIGN="TOP" WIDTH="40%">\n</TD>
|
||||
<TD VALIGN="TOP" WIDTH="43%">The newline character.</TD>
|
||||
<TD VALIGN="TOP" WIDTH="9%"> </TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD VALIGN="TOP" WIDTH="8%"> </TD>
|
||||
<TD VALIGN="TOP" WIDTH="40%">\r</TD>
|
||||
<TD VALIGN="TOP" WIDTH="43%">The carriage return character.</TD>
|
||||
<TD VALIGN="TOP" WIDTH="9%"> </TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD VALIGN="TOP" WIDTH="8%"> </TD>
|
||||
<TD VALIGN="TOP" WIDTH="40%">\t</TD>
|
||||
<TD VALIGN="TOP" WIDTH="43%">The tab character.</TD>
|
||||
<TD VALIGN="TOP" WIDTH="9%"> </TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD VALIGN="TOP" WIDTH="8%"> </TD>
|
||||
<TD VALIGN="TOP" WIDTH="40%">\v</TD>
|
||||
<TD VALIGN="TOP" WIDTH="43%">A vertical tab character.</TD>
|
||||
<TD VALIGN="TOP" WIDTH="9%"> </TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD VALIGN="TOP" WIDTH="8%"> </TD>
|
||||
<TD VALIGN="TOP" WIDTH="40%">\x</TD>
|
||||
<TD VALIGN="TOP" WIDTH="43%">A hexadecimal character - for example \x0D.</TD>
|
||||
<TD VALIGN="TOP" WIDTH="9%"> </TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD VALIGN="TOP" WIDTH="8%"> </TD>
|
||||
<TD VALIGN="TOP" WIDTH="40%">\x{}</TD>
|
||||
<TD VALIGN="TOP" WIDTH="43%">A possible unicode hexadecimal character - for
|
||||
example \x{1A0}</TD>
|
||||
<TD VALIGN="TOP" WIDTH="9%"> </TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD VALIGN="TOP" WIDTH="8%"> </TD>
|
||||
<TD VALIGN="TOP" WIDTH="40%">\cx</TD>
|
||||
<TD VALIGN="TOP" WIDTH="43%">The ASCII escape character x, for example \c@ is
|
||||
equivalent to escape-@.</TD>
|
||||
<TD VALIGN="TOP" WIDTH="9%"> </TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD VALIGN="TOP" WIDTH="8%"> </TD>
|
||||
<TD VALIGN="TOP" WIDTH="40%">\e</TD>
|
||||
<TD VALIGN="TOP" WIDTH="43%">The ASCII escape character.</TD>
|
||||
<TD VALIGN="TOP" WIDTH="9%"> </TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD VALIGN="TOP" WIDTH="8%"> </TD>
|
||||
<TD VALIGN="TOP" WIDTH="40%">\dd</TD>
|
||||
<TD VALIGN="TOP" WIDTH="43%">An octal character constant, for example \10.</TD>
|
||||
<TD VALIGN="TOP" WIDTH="9%"> </TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<BR>
|
||||
<P><B><I>Perl format strings</I></B> </P>
|
||||
<P>Perl format strings are the same as the default syntax except that the
|
||||
characters ()?: have no special meaning. </P>
|
||||
<P><B><I>Sed format strings</I></B> </P>
|
||||
<P>Sed format strings use only the characters \ and & as special
|
||||
characters. </P>
|
||||
<P>\n where n is a digit, is expanded to the nth sub-expression. </P>
|
||||
<P>& is expanded to the whole of the match (equivalent to \0). </P>
|
||||
<P>Other escape sequences are expanded as per the default syntax. <BR>
|
||||
</P>
|
||||
<HR>
|
||||
<P><I>Copyright <A HREF="mailto:John_Maddock@compuserve.com">Dr John
|
||||
Maddock</A> 1998-2000 all rights reserved.</I> </P>
|
||||
</BODY>
|
||||
</HTML>
|
||||
<hr>
|
||||
|
||||
<h3><a name="format_string"></a>Format String Syntax</h3>
|
||||
|
||||
<p>Format strings are used by the algorithms <a
|
||||
href="template_class_ref.htm#reg_format">regex_format</a> and <a
|
||||
href="template_class_ref.htm#reg_merge">regex_merge</a>, and are
|
||||
used to transform one string into another. </p>
|
||||
|
||||
<p>There are three kind of format string: sed, perl and extended,
|
||||
the extended syntax is the default so this is covered first. </p>
|
||||
|
||||
<p><b><i>Extended format syntax</i></b> </p>
|
||||
|
||||
<p>In format strings, all characters are treated as literals
|
||||
except: ()$\?: </p>
|
||||
|
||||
<p>To use any of these as literals you must prefix them with the
|
||||
escape character \ </p>
|
||||
|
||||
<p>The following special sequences are recognized: <br>
|
||||
<br>
|
||||
</p>
|
||||
|
||||
<p><i>Grouping:</i> </p>
|
||||
|
||||
<p>Use the parenthesis characters ( and ) to group sub-expressions
|
||||
within the format string, use \( and \) to represent literal '('
|
||||
and ')'. <br>
|
||||
<br>
|
||||
</p>
|
||||
|
||||
<p><i>Sub-expression expansions:</i> </p>
|
||||
|
||||
<p>The following perl like expressions expand to a particular
|
||||
matched sub-expression: <br>
|
||||
</p>
|
||||
|
||||
<table border="0" cellpadding="7" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td valign="top" width="8%"> </td>
|
||||
<td valign="top" width="40%">$`</td>
|
||||
<td valign="top" width="43%">Expands to all the text from
|
||||
the end of the previous match to the start of the current
|
||||
match, if there was no previous match in the current
|
||||
operation, then everything from the start of the input
|
||||
string to the start of the match.</td>
|
||||
<td valign="top" width="9%"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top" width="8%"> </td>
|
||||
<td valign="top" width="40%">$'</td>
|
||||
<td valign="top" width="43%">Expands to all the text from
|
||||
the end of the match to the end of the input string.</td>
|
||||
<td valign="top" width="9%"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top" width="8%"> </td>
|
||||
<td valign="top" width="40%">$&</td>
|
||||
<td valign="top" width="43%">Expands to all of the
|
||||
current match.</td>
|
||||
<td valign="top" width="9%"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top" width="8%"> </td>
|
||||
<td valign="top" width="40%">$0</td>
|
||||
<td valign="top" width="43%">Expands to all of the
|
||||
current match.</td>
|
||||
<td valign="top" width="9%"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top" width="8%"> </td>
|
||||
<td valign="top" width="40%">$N</td>
|
||||
<td valign="top" width="43%">Expands to the text that
|
||||
matched sub-expression <i>N</i>.</td>
|
||||
<td valign="top" width="9%"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<p><br>
|
||||
</p>
|
||||
|
||||
<p><i>Conditional expressions:</i> </p>
|
||||
|
||||
<p>Conditional expressions allow two different format strings to
|
||||
be selected dependent upon whether a sub-expression participated
|
||||
in the match or not: </p>
|
||||
|
||||
<p>?Ntrue_expression:false_expression </p>
|
||||
|
||||
<p>Executes true_expression if sub-expression <i>N</i>
|
||||
participated in the match, otherwise executes false_expression. </p>
|
||||
|
||||
<p>Example: suppose we search for "(while)|(for)" then
|
||||
the format string "?1WHILE:FOR" would output what
|
||||
matched, but in upper case. <br>
|
||||
<br>
|
||||
</p>
|
||||
|
||||
<p><i>Escape sequences:</i> </p>
|
||||
|
||||
<p>The following escape sequences are also allowed: <br>
|
||||
</p>
|
||||
|
||||
<table border="0" cellpadding="7" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td valign="top" width="8%"> </td>
|
||||
<td valign="top" width="40%">\a</td>
|
||||
<td valign="top" width="43%">The bell character.</td>
|
||||
<td valign="top" width="9%"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top" width="8%"> </td>
|
||||
<td valign="top" width="40%">\f</td>
|
||||
<td valign="top" width="43%">The form feed character.</td>
|
||||
<td valign="top" width="9%"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top" width="8%"> </td>
|
||||
<td valign="top" width="40%">\n</td>
|
||||
<td valign="top" width="43%">The newline character.</td>
|
||||
<td valign="top" width="9%"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top" width="8%"> </td>
|
||||
<td valign="top" width="40%">\r</td>
|
||||
<td valign="top" width="43%">The carriage return
|
||||
character.</td>
|
||||
<td valign="top" width="9%"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top" width="8%"> </td>
|
||||
<td valign="top" width="40%">\t</td>
|
||||
<td valign="top" width="43%">The tab character.</td>
|
||||
<td valign="top" width="9%"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top" width="8%"> </td>
|
||||
<td valign="top" width="40%">\v</td>
|
||||
<td valign="top" width="43%">A vertical tab character.</td>
|
||||
<td valign="top" width="9%"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top" width="8%"> </td>
|
||||
<td valign="top" width="40%">\x</td>
|
||||
<td valign="top" width="43%">A hexadecimal character -
|
||||
for example \x0D.</td>
|
||||
<td valign="top" width="9%"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top" width="8%"> </td>
|
||||
<td valign="top" width="40%">\x{}</td>
|
||||
<td valign="top" width="43%">A possible unicode
|
||||
hexadecimal character - for example \x{1A0}</td>
|
||||
<td valign="top" width="9%"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top" width="8%"> </td>
|
||||
<td valign="top" width="40%">\cx</td>
|
||||
<td valign="top" width="43%">The ASCII escape character
|
||||
x, for example \c@ is equivalent to escape-@.</td>
|
||||
<td valign="top" width="9%"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top" width="8%"> </td>
|
||||
<td valign="top" width="40%">\e</td>
|
||||
<td valign="top" width="43%">The ASCII escape character.</td>
|
||||
<td valign="top" width="9%"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top" width="8%"> </td>
|
||||
<td valign="top" width="40%">\dd</td>
|
||||
<td valign="top" width="43%">An octal character constant,
|
||||
for example \10.</td>
|
||||
<td valign="top" width="9%"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<p><br>
|
||||
</p>
|
||||
|
||||
<p><b><i>Perl format strings</i></b> </p>
|
||||
|
||||
<p>Perl format strings are the same as the default syntax except
|
||||
that the characters ()?: have no special meaning. </p>
|
||||
|
||||
<p><b><i>Sed format strings</i></b> </p>
|
||||
|
||||
<p>Sed format strings use only the characters \ and & as
|
||||
special characters. </p>
|
||||
|
||||
<p>\n where n is a digit, is expanded to the nth sub-expression. </p>
|
||||
|
||||
<p>& is expanded to the whole of the match (equivalent to \0).
|
||||
</p>
|
||||
|
||||
<p>Other escape sequences are expanded as per the default syntax.
|
||||
<br>
|
||||
</p>
|
||||
|
||||
<hr>
|
||||
|
||||
<p><i>Copyright </i><a href="mailto:John_Maddock@compuserve.com"><i>Dr
|
||||
John Maddock</i></a><i> 1998-2000 all rights reserved.</i> </p>
|
||||
</body>
|
||||
</html>
|
||||
|
33
hl_ref.htm
33
hl_ref.htm
@ -15,23 +15,24 @@ content="C:\PROGRAM FILES\MICROSOFT OFFICE\OFFICE\html.dot">
|
||||
|
||||
<table border="0" cellpadding="7" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td valign="top" width="50%"><h3><img
|
||||
src="../../c++boost.gif" alt="C++ Boost" width="276"
|
||||
height="86"></h3>
|
||||
<td valign="top"><h3><img src="../../c++boost.gif"
|
||||
alt="C++ Boost" width="276" height="86"></h3>
|
||||
</td>
|
||||
<td valign="top" width="50%"><h3 align="center">Regex++,
|
||||
RegEx Class Reference. </h3>
|
||||
<p><i>(version 3.12, 18 April 2000)</i> </p>
|
||||
<pre><i>Copyright (c) 1998-2000
|
||||
Dr John Maddock
|
||||
|
||||
Permission to use, copy, modify, distribute and sell this software
|
||||
and its documentation for any purpose is hereby granted without fee,
|
||||
provided that the above copyright notice appear in all copies and
|
||||
that both that copyright notice and this permission notice appear
|
||||
in supporting documentation. Dr John Maddock makes no representations
|
||||
about the suitability of this software for any purpose.
|
||||
It is provided "as is" without express or implied warranty.</i></pre>
|
||||
<td valign="top"><h3 align="center">Regex++, RegEx Class
|
||||
Reference. </h3>
|
||||
<p align="left"><i>(Version 3.20, 29th Sept 2001)</i>
|
||||
</p>
|
||||
<p align="left"><i>Copyright (c) 1998-2001 </i></p>
|
||||
<p align="left"><i>Dr John Maddock</i></p>
|
||||
<p align="left"><i>Permission to use, copy, modify,
|
||||
distribute and sell this software and its documentation
|
||||
for any purpose is hereby granted without fee, provided
|
||||
that the above copyright notice appear in all copies and
|
||||
that both that copyright notice and this permission
|
||||
notice appear in supporting documentation. Dr John
|
||||
Maddock makes no representations about the suitability of
|
||||
this software for any purpose. It is provided "as is"
|
||||
without express or implied warranty.</i></p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
@ -16,7 +16,7 @@
|
||||
/*
|
||||
* LOCATION: see http://www.boost.org for most recent version.
|
||||
* FILE config.hpp
|
||||
* VERSION 3.12
|
||||
* VERSION see <boost/version.hpp>
|
||||
* DESCRIPTION: regex extended config setup.
|
||||
*/
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
/*
|
||||
* LOCATION: see http://www.boost.org for most recent version.
|
||||
* FILE fileiter.hpp
|
||||
* VERSION 3.12
|
||||
* VERSION see <boost/version.hpp>
|
||||
* DESCRIPTION: Declares various platform independent file and
|
||||
* directory iterators, plus binary file input in
|
||||
* the form of class map_file.
|
||||
|
@ -16,7 +16,7 @@
|
||||
/*
|
||||
* LOCATION: see http://www.boost.org for most recent version.
|
||||
* FILE regex_compile.hpp
|
||||
* VERSION 3.12
|
||||
* VERSION see <boost/version.hpp>
|
||||
* DESCRIPTION: Declares reg_expression<> member functions. This is
|
||||
* an internal header file, do not include directly.
|
||||
*/
|
||||
|
@ -16,7 +16,7 @@
|
||||
/*
|
||||
* LOCATION: see http://www.boost.org for most recent version.
|
||||
* FILE regex_cstring.hpp
|
||||
* VERSION 3.12
|
||||
* VERSION see <boost/version.hpp>
|
||||
* DESCRIPTION: This is an internal header file, do not include directly.
|
||||
* String support and helper functions, for regular
|
||||
* expression library.
|
||||
|
@ -16,7 +16,7 @@
|
||||
/*
|
||||
* LOCATION: see http://www.boost.org for most recent version.
|
||||
* FILE regex_format.hpp
|
||||
* VERSION 3.12
|
||||
* VERSION see <boost/version.hpp>
|
||||
* DESCRIPTION: Provides formatting output routines for search and replace
|
||||
* operations. Note this is an internal header file included
|
||||
* by regex.hpp, do not include on its own.
|
||||
|
@ -16,7 +16,7 @@
|
||||
/*
|
||||
* LOCATION: see http://www.boost.org for most recent version.
|
||||
* FILE regex_kmp.hpp
|
||||
* VERSION 3.12
|
||||
* VERSION see <boost/version.hpp>
|
||||
* DESCRIPTION: Provides Knuth Morris Pratt search operations.
|
||||
* Note this is an internal header file included
|
||||
* by regex.hpp, do not include on its own.
|
||||
|
@ -16,7 +16,7 @@
|
||||
/*
|
||||
* LOCATION: see http://www.boost.org for most recent version.
|
||||
* FILE regex_libary_include.hpp
|
||||
* VERSION 3.12
|
||||
* VERSION see <boost/version.hpp>
|
||||
* DESCRIPTION: Automatic library inclusion for Borland/Microsoft compilers.
|
||||
* Note this is an internal header file included
|
||||
* by regex.hpp, do not include on its own.
|
||||
|
@ -16,7 +16,7 @@
|
||||
/*
|
||||
* LOCATION: see http://www.boost.org for most recent version.
|
||||
* FILE regex_match.hpp
|
||||
* VERSION 3.12
|
||||
* VERSION see <boost/version.hpp>
|
||||
* DESCRIPTION: Regular expression matching algorithms.
|
||||
* Note this is an internal header file included
|
||||
* by regex.hpp, do not include on its own.
|
||||
|
@ -16,7 +16,7 @@
|
||||
/*
|
||||
* LOCATION: see http://www.boost.org for most recent version.
|
||||
* FILE regex_raw_buffer.hpp
|
||||
* VERSION 3.12
|
||||
* VERSION see <boost/version.hpp>
|
||||
* DESCRIPTION: Raw character buffer for regex code.
|
||||
* Note this is an internal header file included
|
||||
* by regex.hpp, do not include on its own.
|
||||
|
@ -16,7 +16,7 @@
|
||||
/*
|
||||
* LOCATION: see http://www.boost.org for most recent version.
|
||||
* FILE regex_split.hpp
|
||||
* VERSION 3.12
|
||||
* VERSION see <boost/version.hpp>
|
||||
* DESCRIPTION: Implements regex_split and associated functions.
|
||||
* Note this is an internal header file included
|
||||
* by regex.hpp, do not include on its own.
|
||||
|
@ -16,7 +16,7 @@
|
||||
/*
|
||||
* LOCATION: see http://www.boost.org for most recent version.
|
||||
* FILE regex_stack.hpp
|
||||
* VERSION 3.12
|
||||
* VERSION see <boost/version.hpp>
|
||||
* DESCRIPTION: Implements customised internal regex stacks.
|
||||
* Note this is an internal header file included
|
||||
* by regex.hpp, do not include on its own.
|
||||
|
@ -16,7 +16,7 @@
|
||||
/*
|
||||
* LOCATION: see http://www.boost.org for most recent version.
|
||||
* FILE regex_synch.hpp
|
||||
* VERSION 3.12
|
||||
* VERSION see <boost/version.hpp>
|
||||
* DESCRIPTION: Thread synchronisation for regex code.
|
||||
* Note this is an internal header file included
|
||||
* by regex.hpp, do not include on its own.
|
||||
|
@ -16,7 +16,7 @@
|
||||
/*
|
||||
* LOCATION: see http://www.boost.org for most recent version.
|
||||
* FILE pattern_except.hpp
|
||||
* VERSION 3.12
|
||||
* VERSION see <boost/version.hpp>
|
||||
* DESCRIPTION: Declares pattern-matching exception classes.
|
||||
*/
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
/*
|
||||
* LOCATION: see http://www.boost.org for most recent version.
|
||||
* FILE regex_traits.hpp
|
||||
* VERSION 3.12
|
||||
* VERSION see <boost/version.hpp>
|
||||
* DESCRIPTION: Declares regular expression traits classes.
|
||||
*/
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
/*
|
||||
* LOCATION: see http://www.boost.org for most recent version.
|
||||
* FILE src.cpp
|
||||
* VERSION 3.11
|
||||
* VERSION see <boost/version.hpp>
|
||||
* DESCRIPTION: Includes all the regex source files, include this
|
||||
* file only if you need to build the regex library
|
||||
* as a single file. Before including this file you
|
||||
|
@ -16,7 +16,7 @@
|
||||
/*
|
||||
* LOCATION: see http://www.boost.org for most recent version.
|
||||
* FILE user.hpp
|
||||
* VERSION 3.12
|
||||
* VERSION see <boost/version.hpp>
|
||||
* DESCRIPTION: User settable options.
|
||||
*/
|
||||
|
||||
|
59
index.htm
59
index.htm
@ -17,23 +17,23 @@ content="C:\PROGRAM FILES\MICROSOFT OFFICE\OFFICE\html.dot">
|
||||
|
||||
<table border="0" cellpadding="7" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td valign="top" width="50%"><h3><img
|
||||
src="../../c++boost.gif" alt="C++ Boost" width="277"
|
||||
height="86"></h3>
|
||||
<td valign="top"><h3><img src="../../c++boost.gif"
|
||||
alt="C++ Boost" width="277" height="86"></h3>
|
||||
</td>
|
||||
<td valign="top" width="50%"><h3 align="center">Regex++,
|
||||
Index.</h3>
|
||||
<p><i>(version 3.12, 18 April 2000)</i> </p>
|
||||
<pre><i>Copyright (c) 1998-2000
|
||||
Dr John Maddock
|
||||
|
||||
Permission to use, copy, modify, distribute and sell this software
|
||||
and its documentation for any purpose is hereby granted without fee,
|
||||
provided that the above copyright notice appear in all copies and
|
||||
that both that copyright notice and this permission notice appear
|
||||
in supporting documentation. Dr John Maddock makes no representations
|
||||
about the suitability of this software for any purpose.
|
||||
It is provided "as is" without express or implied warranty.</i></pre>
|
||||
<td valign="top"><h3 align="center">Regex++, Index.</h3>
|
||||
<p align="left"><i>(Version 3.20, 29th Sept 2001)</i>
|
||||
</p>
|
||||
<p align="left"><i>Copyright (c) 1998-2001 </i></p>
|
||||
<p align="left"><i>Dr John Maddock</i></p>
|
||||
<p align="left"><i>Permission to use, copy, modify,
|
||||
distribute and sell this software and its documentation
|
||||
for any purpose is hereby granted without fee, provided
|
||||
that the above copyright notice appear in all copies and
|
||||
that both that copyright notice and this permission
|
||||
notice appear in supporting documentation. Dr John
|
||||
Maddock makes no representations about the suitability of
|
||||
this software for any purpose. It is provided "as is"
|
||||
without express or implied warranty.</i></p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -92,33 +92,42 @@ It is provided "as is" without express or implied warranty.</i></pre>
|
||||
<li><a href="appendix.htm#localisation">Localization</a></li>
|
||||
<li><a href="appendix.htm#demos">Example Applications</a>
|
||||
<ul>
|
||||
<li><a href="example/snippets/regex_match_example.cpp">regex_match_example.cpp</a>:
|
||||
<li><a
|
||||
href="example/snippets/regex_match_example.cpp">regex_match_example.cpp</a>:
|
||||
ftp based regex_match example.</li>
|
||||
<li><a href="example/snippets/regex_search_example.cpp">regex_search_example.cpp</a>:
|
||||
<li><a
|
||||
href="example/snippets/regex_search_example.cpp">regex_search_example.cpp</a>:
|
||||
regex_search example: searches a cpp file
|
||||
for class definitions.</li>
|
||||
<li><a href="example/snippets/regex_grep_example_1.cpp">regex_grep_example_1.cpp</a>:
|
||||
<li><a
|
||||
href="example/snippets/regex_grep_example_1.cpp">regex_grep_example_1.cpp</a>:
|
||||
regex_grep example 1: searches a cpp file
|
||||
for class definitions.</li>
|
||||
<li><a href="example/snippets/regex_merge_example.cpp">regex_merge_example.cpp</a>:
|
||||
<li><a
|
||||
href="example/snippets/regex_merge_example.cpp">regex_merge_example.cpp</a>:
|
||||
regex_merge example: converts a C++ file
|
||||
to syntax highlighted HTML.</li>
|
||||
<li><a href="example/snippets/regex_grep_example_2.cpp">regex_grep_example_2.cpp</a>:
|
||||
<li><a
|
||||
href="example/snippets/regex_grep_example_2.cpp">regex_grep_example_2.cpp</a>:
|
||||
regex_grep example 2: searches a cpp file
|
||||
for class definitions, using a global
|
||||
callback function. </li>
|
||||
<li><a href="example/snippets/regex_grep_example_3.cpp">regex_grep_example_3.cpp</a>:
|
||||
<li><a
|
||||
href="example/snippets/regex_grep_example_3.cpp">regex_grep_example_3.cpp</a>:
|
||||
regex_grep example 2: searches a cpp file
|
||||
for class definitions, using a bound
|
||||
member function callback.</li>
|
||||
<li><a href="example/snippets/regex_grep_example_4.cpp">regex_grep_example_4.cpp</a>:
|
||||
<li><a
|
||||
href="example/snippets/regex_grep_example_4.cpp">regex_grep_example_4.cpp</a>:
|
||||
regex_grep example 2: searches a cpp file
|
||||
for class definitions, using a C++
|
||||
Builder closure as a callback.</li>
|
||||
<li><a href="example/snippets/regex_split_example_1.cpp">regex_split_example_1.cpp</a>:
|
||||
<li><a
|
||||
href="example/snippets/regex_split_example_1.cpp">regex_split_example_1.cpp</a>:
|
||||
regex_split example: split a string into
|
||||
tokens.</li>
|
||||
<li><a href="example/snippets/regex_split_example_2.cpp">regex_split_example_2.cpp</a>:
|
||||
<li><a
|
||||
href="example/snippets/regex_split_example_2.cpp">regex_split_example_2.cpp</a>:
|
||||
regex_split example: spit out linked
|
||||
URL's.</li>
|
||||
</ul>
|
||||
|
@ -15,25 +15,25 @@ content="C:\PROGRAM FILES\MICROSOFT OFFICE\OFFICE\html.dot">
|
||||
|
||||
<p> </p>
|
||||
|
||||
<table border="0" cellpadding="7" cellspacing="0" width="624">
|
||||
<table border="0" cellpadding="7" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td valign="top" width="50%"><h3><img
|
||||
src="../../c++boost.gif" alt="C++ Boost" width="276"
|
||||
height="86"></h3>
|
||||
<td valign="top"><h3><img src="../../c++boost.gif"
|
||||
alt="C++ Boost" width="276" height="86"></h3>
|
||||
</td>
|
||||
<td valign="top" width="50%"><h3 align="center">Regex++,
|
||||
Introduction.</h3>
|
||||
<p><i>(version 3.12, 18 April 2000)</i> </p>
|
||||
<pre><i>Copyright (c) 1998-2000
|
||||
Dr John Maddock
|
||||
|
||||
Permission to use, copy, modify, distribute and sell this software
|
||||
and its documentation for any purpose is hereby granted without fee,
|
||||
provided that the above copyright notice appear in all copies and
|
||||
that both that copyright notice and this permission notice appear
|
||||
in supporting documentation. Dr John Maddock makes no representations
|
||||
about the suitability of this software for any purpose.
|
||||
It is provided "as is" without express or implied warranty.</i></pre>
|
||||
<td valign="top"><h3 align="center">Regex++, Introduction.</h3>
|
||||
<p align="left"><i>(Version 3.20, 29th Sept 2001)</i>
|
||||
</p>
|
||||
<p align="left"><i>Copyright (c) 1998-2001 </i></p>
|
||||
<p align="left"><i>Dr John Maddock</i></p>
|
||||
<p align="left"><i>Permission to use, copy, modify,
|
||||
distribute and sell this software and its documentation
|
||||
for any purpose is hereby granted without fee, provided
|
||||
that the above copyright notice appear in all copies and
|
||||
that both that copyright notice and this permission
|
||||
notice appear in supporting documentation. Dr John
|
||||
Maddock makes no representations about the suitability of
|
||||
this software for any purpose. It is provided "as is"
|
||||
without express or implied warranty.</i></p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
@ -15,7 +15,7 @@
|
||||
|
||||
/*
|
||||
* FILE cregex.h
|
||||
* VERSION 2.21
|
||||
* VERSION see <boost/version.hpp>
|
||||
* deprecated regular expression matching algorithms
|
||||
*/
|
||||
|
||||
|
@ -15,7 +15,7 @@
|
||||
|
||||
/*
|
||||
* FILE regex.h
|
||||
* VERSION 2.21
|
||||
* VERSION see <boost/version.hpp>
|
||||
* deprecated regular expression matching algorithms
|
||||
*/
|
||||
|
||||
|
549
posix_ref.htm
549
posix_ref.htm
@ -1,66 +1,74 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//w3c//dtd html 4.0 transitional//en">
|
||||
<html>
|
||||
|
||||
<HTML>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type"
|
||||
content="text/html; charset=iso-8859-1">
|
||||
<meta name="Template"
|
||||
content="C:\PROGRAM FILES\MICROSOFT OFFICE\OFFICE\html.dot">
|
||||
<meta name="GENERATOR" content="Microsoft FrontPage Express 2.0">
|
||||
<title>Regex++, POSIX API Reference</title>
|
||||
</head>
|
||||
|
||||
<HEAD>
|
||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
|
||||
<META NAME="Template"
|
||||
CONTENT="C:\PROGRAM FILES\MICROSOFT OFFICE\OFFICE\html.dot">
|
||||
<META NAME="GENERATOR" CONTENT="Mozilla/4.5 [en] (Win98; I) [Netscape]">
|
||||
<TITLE>Regex++, POSIX API Reference</TITLE>
|
||||
</HEAD>
|
||||
<body bgcolor="#FFFFFF" link="#0000FF" vlink="#800080">
|
||||
|
||||
<BODY BGCOLOR="#FFFFFF" LINK="#0000FF" VLINK="#800080">
|
||||
<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="7" WIDTH="100%">
|
||||
<TR>
|
||||
<TD VALIGN="TOP" WIDTH="50%"> <H3>
|
||||
<IMG SRC="../../c++boost.gif" HEIGHT="86" WIDTH="276" ALT="C++ Boost"></H3>
|
||||
</TD>
|
||||
<TD VALIGN="TOP" WIDTH="50%"> <CENTER>
|
||||
<H3> Regex++, POSIX API Reference.</H3>
|
||||
</CENTER>
|
||||
<CENTER>
|
||||
<I>(version 3.12, 18 April 2000)</I>
|
||||
</CENTER>
|
||||
<PRE><I>Copyright (c) 1998-2000
|
||||
Dr John Maddock
|
||||
<p> </p>
|
||||
|
||||
Permission to use, copy, modify, distribute and sell this software
|
||||
and its documentation for any purpose is hereby granted without fee,
|
||||
provided that the above copyright notice appear in all copies and
|
||||
that both that copyright notice and this permission notice appear
|
||||
in supporting documentation. Dr John Maddock makes no representations
|
||||
about the suitability of this software for any purpose.
|
||||
It is provided "as is" without express or implied warranty.</I></PRE>
|
||||
<table border="0" cellpadding="7" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td valign="top"><h3><img src="../../c++boost.gif"
|
||||
alt="C++ Boost" width="276" height="86"></h3>
|
||||
</td>
|
||||
<td valign="top"><h3 align="center">Regex++, POSIX API
|
||||
Reference.</h3>
|
||||
<p align="left"><i>(Version 3.20, 29th Sept 2001)</i>
|
||||
</p>
|
||||
<p align="left"><i>Copyright (c) 1998-2001 </i></p>
|
||||
<p align="left"><i>Dr John Maddock</i></p>
|
||||
<p align="left"><i>Permission to use, copy, modify,
|
||||
distribute and sell this software and its documentation
|
||||
for any purpose is hereby granted without fee, provided
|
||||
that the above copyright notice appear in all copies and
|
||||
that both that copyright notice and this permission
|
||||
notice appear in supporting documentation. Dr John
|
||||
Maddock makes no representations about the suitability of
|
||||
this software for any purpose. It is provided "as is"
|
||||
without express or implied warranty.</i></p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<HR>
|
||||
<H3> <A NAME="posix"></A><I>POSIX compatibility library</I></H3>
|
||||
<PRE>#include <boost/cregex.hpp>
|
||||
<I>or</I>:
|
||||
#include <boost/regex.h></PRE>
|
||||
<hr>
|
||||
|
||||
<P>The following functions are available for users who need a POSIX compatible
|
||||
C library, they are available in both Unicode and narrow character versions,
|
||||
the standard POSIX API names are macros that expand to one version or the other
|
||||
depending upon whether UNICODE is defined or not. </P>
|
||||
<P><B>Important</B>: Note that all the symbols defined here are enclosed inside
|
||||
namespace <I>boost</I> when used in C++ programs, unless you use #include
|
||||
<boost/regex.h> instead - in which case the symbols are still defined in
|
||||
namespace boost, but are made available in the global namespace as well.</P>
|
||||
<P>The functions are defined as: </P>
|
||||
<PRE>extern "C" {
|
||||
<B>int</B> regcompA(regex_tA*, <B>const</B> <B>char</B>*, <B>int</B>);
|
||||
<B>unsigned</B> <B>int</B> regerrorA(<B>int</B>, <B>const</B> regex_tA*, <B>char</B>*, <B>unsigned</B> <B>int</B>);
|
||||
<B>int</B> regexecA(<B>const</B> regex_tA*, <B>const</B> <B>char</B>*, <B>unsigned</B> <B>int</B>, regmatch_t*, <B>int</B>);
|
||||
<B>void</B> regfreeA(regex_tA*);
|
||||
<h3><a name="posix"></a><i>POSIX compatibility library</i></h3>
|
||||
|
||||
<B>int</B> regcompW(regex_tW*, <B>const</B> <B>wchar_t</B>*, <B>int</B>);
|
||||
<B>unsigned</B> <B>int</B> regerrorW(<B>int</B>, <B>const</B> regex_tW*, <B>wchar_t</B>*, <B>unsigned</B> <B>int</B>);
|
||||
<B>int</B> regexecW(<B>const</B> regex_tW*, <B>const</B> <B>wchar_t</B>*, <B>unsigned</B> <B>int</B>, regmatch_t*, <B>int</B>);
|
||||
<B>void</B> regfreeW(regex_tW*);
|
||||
<pre>#include <boost/cregex.hpp>
|
||||
<i>or</i>:
|
||||
#include <boost/regex.h></pre>
|
||||
|
||||
<p>The following functions are available for users who need a
|
||||
POSIX compatible C library, they are available in both Unicode
|
||||
and narrow character versions, the standard POSIX API names are
|
||||
macros that expand to one version or the other depending upon
|
||||
whether UNICODE is defined or not. </p>
|
||||
|
||||
<p><b>Important</b>: Note that all the symbols defined here are
|
||||
enclosed inside namespace <i>boost</i> when used in C++ programs,
|
||||
unless you use #include <boost/regex.h> instead - in which
|
||||
case the symbols are still defined in namespace boost, but are
|
||||
made available in the global namespace as well.</p>
|
||||
|
||||
<p>The functions are defined as: </p>
|
||||
|
||||
<pre>extern "C" {
|
||||
<b>int</b> regcompA(regex_tA*, <b>const</b> <b>char</b>*, <b>int</b>);
|
||||
<b>unsigned</b> <b>int</b> regerrorA(<b>int</b>, <b>const</b> regex_tA*, <b>char</b>*, <b>unsigned</b> <b>int</b>);
|
||||
<b>int</b> regexecA(<b>const</b> regex_tA*, <b>const</b> <b>char</b>*, <b>unsigned</b> <b>int</b>, regmatch_t*, <b>int</b>);
|
||||
<b>void</b> regfreeA(regex_tA*);
|
||||
|
||||
<b>int</b> regcompW(regex_tW*, <b>const</b> <b>wchar_t</b>*, <b>int</b>);
|
||||
<b>unsigned</b> <b>int</b> regerrorW(<b>int</b>, <b>const</b> regex_tW*, <b>wchar_t</b>*, <b>unsigned</b> <b>int</b>);
|
||||
<b>int</b> regexecW(<b>const</b> regex_tW*, <b>const</b> <b>wchar_t</b>*, <b>unsigned</b> <b>int</b>, regmatch_t*, <b>int</b>);
|
||||
<b>void</b> regfreeW(regex_tW*);
|
||||
|
||||
#ifdef UNICODE
|
||||
#define regcomp regcompW
|
||||
@ -75,203 +83,234 @@ namespace boost, but are made available in the global namespace as well.</P>
|
||||
#define regfree regfreeA
|
||||
#define regex_t regex_tA
|
||||
#endif
|
||||
}</PRE>
|
||||
All the functions operate on structure <B>regex_t</B>, which exposes two public
|
||||
members:
|
||||
<P><B>unsigned int re_nsub</B> this is filled in by <B>regcomp</B> and
|
||||
indicates the number of sub-expressions contained in the regular expression.
|
||||
</P>
|
||||
<P><B>const TCHAR* re_endp</B> points to the end of the expression to compile
|
||||
when the flag REG_PEND is set. </P>
|
||||
<P><I>Footnote: regex_t is actually a #define - it is either regex_tA or
|
||||
regex_tW depending upon whether UNICODE is defined or not, TCHAR is either char
|
||||
or wchar_t again depending upon the macro UNICODE.</I> </P>
|
||||
<P><B>regcomp</B> takes a pointer to a <B>regex_t</B>, a pointer to the
|
||||
expression to compile and a flags parameter which can be a combination of: <BR>
|
||||
</P>
|
||||
<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="7" WIDTH="100%">
|
||||
<TR>
|
||||
<TD WIDTH="5%"> </TD>
|
||||
<TD VALIGN="TOP" WIDTH="45%">REG_EXTENDED</TD>
|
||||
<TD VALIGN="TOP" WIDTH="45%">Compiles modern regular expressions. Equivalent to
|
||||
regbase::char_classes | regbase::intervals | regbase::bk_refs.</TD>
|
||||
<TD WIDTH="5%"> </TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH="5%"> </TD>
|
||||
<TD VALIGN="TOP" WIDTH="45%">REG_BASIC</TD>
|
||||
<TD VALIGN="TOP" WIDTH="45%">Compiles basic (obsolete) regular expression
|
||||
syntax. Equivalent to regbase::char_classes | regbase::intervals |
|
||||
regbase::limited_ops | regbase::bk_braces | regbase::bk_parens |
|
||||
regbase::bk_refs.</TD>
|
||||
<TD WIDTH="5%"> </TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH="5%"> </TD>
|
||||
<TD VALIGN="TOP" WIDTH="45%">REG_NOSPEC</TD>
|
||||
<TD VALIGN="TOP" WIDTH="45%">All characters are ordinary, the expression is a
|
||||
literal string.</TD>
|
||||
<TD WIDTH="5%"> </TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH="5%"> </TD>
|
||||
<TD VALIGN="TOP" WIDTH="45%">REG_ICASE</TD>
|
||||
<TD VALIGN="TOP" WIDTH="45%">Compiles for matching that ignores character
|
||||
case.</TD>
|
||||
<TD WIDTH="5%"> </TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH="5%"> </TD>
|
||||
<TD VALIGN="TOP" WIDTH="45%">REG_NOSUB</TD>
|
||||
<TD VALIGN="TOP" WIDTH="45%">Has no effect in this library.</TD>
|
||||
<TD WIDTH="5%"> </TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH="5%"> </TD>
|
||||
<TD VALIGN="TOP" WIDTH="45%">REG_NEWLINE</TD>
|
||||
<TD VALIGN="TOP" WIDTH="45%">When this flag is set a dot does not match the
|
||||
newline character.</TD>
|
||||
<TD WIDTH="5%"> </TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH="5%"> </TD>
|
||||
<TD VALIGN="TOP" WIDTH="45%">REG_PEND</TD>
|
||||
<TD VALIGN="TOP" WIDTH="45%">When this flag is set the re_endp parameter of the
|
||||
regex_t structure must point to the end of the regular expression to
|
||||
compile.</TD>
|
||||
<TD WIDTH="5%"> </TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH="5%"> </TD>
|
||||
<TD VALIGN="TOP" WIDTH="45%">REG_NOCOLLATE</TD>
|
||||
<TD VALIGN="TOP" WIDTH="45%">When this flag is set then locale dependent
|
||||
collation for character ranges is turned off.</TD>
|
||||
<TD WIDTH="5%"> </TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH="5%"> </TD>
|
||||
<TD VALIGN="TOP" WIDTH="45%">REG_ESCAPE_IN_LISTS<BR>
|
||||
, , , </TD>
|
||||
<TD VALIGN="TOP" WIDTH="45%">When this flag is set, then escape sequences are
|
||||
permitted in bracket expressions (character sets).</TD>
|
||||
<TD WIDTH="5%"> </TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH="5%"> </TD>
|
||||
<TD VALIGN="TOP" WIDTH="45%">REG_NEWLINE_ALT </TD>
|
||||
<TD VALIGN="TOP" WIDTH="45%">When this flag is set then the newline character
|
||||
is equivalent to the alternation operator |.</TD>
|
||||
<TD WIDTH="5%"> </TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH="5%"> </TD>
|
||||
<TD VALIGN="TOP" WIDTH="45%">REG_PERL </TD>
|
||||
<TD VALIGN="TOP" WIDTH="45%"> A shortcut for perl-like behavior:
|
||||
REG_EXTENDED | REG_NOCOLLATE | REG_ESCAPE_IN_LISTS</TD>
|
||||
<TD WIDTH="5%"> </TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH="5%"> </TD>
|
||||
<TD VALIGN="TOP" WIDTH="45%">REG_AWK</TD>
|
||||
<TD VALIGN="TOP" WIDTH="45%">A shortcut for awk-like behavior: REG_EXTENDED |
|
||||
REG_ESCAPE_IN_LISTS</TD>
|
||||
<TD WIDTH="5%"> </TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH="5%"> </TD>
|
||||
<TD VALIGN="TOP" WIDTH="45%">REG_GREP</TD>
|
||||
<TD VALIGN="TOP" WIDTH="45%">A shortcut for grep like behavior: REG_BASIC |
|
||||
REG_NEWLINE_ALT</TD>
|
||||
<TD WIDTH="5%"> </TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH="5%"> </TD>
|
||||
<TD VALIGN="TOP" WIDTH="45%">REG_EGREP</TD>
|
||||
<TD VALIGN="TOP" WIDTH="45%"> A shortcut for egrep like behavior:
|
||||
REG_EXTENDED | REG_NEWLINE_ALT</TD>
|
||||
<TD WIDTH="5%"> </TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<BR>
|
||||
<P><B>regerror</B> takes the following parameters, it maps an error code
|
||||
to a human readable string: <BR>
|
||||
</P>
|
||||
<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="7" WIDTH="100%">
|
||||
<TR>
|
||||
<TD WIDTH="5%"> </TD>
|
||||
<TD VALIGN="TOP" WIDTH="50%">int code</TD>
|
||||
<TD VALIGN="TOP" WIDTH="50%">The error code.</TD>
|
||||
<TD WIDTH="5%"> </TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD> </TD>
|
||||
<TD VALIGN="TOP" WIDTH="50%">const regex_t* e</TD>
|
||||
<TD VALIGN="TOP" WIDTH="50%">The regular expression (can be null).</TD>
|
||||
<TD> </TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD> </TD>
|
||||
<TD VALIGN="TOP" WIDTH="50%">char* buf</TD>
|
||||
<TD VALIGN="TOP" WIDTH="50%">The buffer to fill in with the error message.</TD>
|
||||
<TD> </TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD> </TD>
|
||||
<TD VALIGN="TOP" WIDTH="50%">unsigned int buf_size</TD>
|
||||
<TD VALIGN="TOP" WIDTH="50%">The length of buf.</TD>
|
||||
<TD> </TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<P>If the error code is OR'ed with REG_ITOA then the message that results is
|
||||
the printable name of the code rather than a message, for example
|
||||
"REG_BADPAT". If the code is REG_ATIO then <B>e</B> must not be null
|
||||
and <B>e->re_pend</B> must point to the printable name of an error code, the
|
||||
return value is then the value of the error code. For any other value of
|
||||
<B>code</B>, the return value is the number of characters in the error message,
|
||||
if the return value is greater than or equal to <B>buf_size</B> then
|
||||
<B>regerror</B> will have to be called again with a larger buffer.</P>
|
||||
<P><B>regexec</B> finds the first occurrence of expression <B>e</B> within
|
||||
string <B>buf</B>. If <B>len</B> is non-zero then *<B>m</B> is filled in with
|
||||
what matched the regular expression, <B>m[0]</B> contains what matched the
|
||||
whole string, <B>m[1] </B>the first sub-expression etc, see <B>regmatch_t</B>
|
||||
in the header file declaration for more details. The <B>eflags</B> parameter
|
||||
can be a combination of: <BR>
|
||||
</P>
|
||||
<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="7" WIDTH="100%">
|
||||
<TR>
|
||||
<TD WIDTH="5%"> </TD>
|
||||
<TD VALIGN="TOP" WIDTH="50%">REG_NOTBOL</TD>
|
||||
<TD VALIGN="TOP" WIDTH="50%">Parameter <B>buf </B>does not represent the start
|
||||
of a line.</TD>
|
||||
<TD WIDTH="5%"> </TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD> </TD>
|
||||
<TD VALIGN="TOP" WIDTH="50%">REG_NOTEOL</TD>
|
||||
<TD VALIGN="TOP" WIDTH="50%">Parameter <B>buf</B> does not terminate at the end
|
||||
of a line.</TD>
|
||||
<TD> </TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD> </TD>
|
||||
<TD VALIGN="TOP" WIDTH="50%">REG_STARTEND</TD>
|
||||
<TD VALIGN="TOP" WIDTH="50%">The string searched starts at buf +
|
||||
pmatch[0].rm_so and ends at buf + pmatch[0].rm_eo.</TD>
|
||||
<TD> </TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<BR>
|
||||
<P>Finally <B>regfree</B> frees all the memory that was allocated by
|
||||
regcomp. </P>
|
||||
<P><I>Footnote: this is an abridged reference to the POSIX API functions, it is
|
||||
provided for compatibility with other libraries, rather than an API to be used
|
||||
in new code (unless you need access from a language other than C++). This
|
||||
version of these functions should also happily coexist with other versions, as
|
||||
the names used are macros that expand to the actual function names.</I> <BR>
|
||||
</P>
|
||||
<HR>
|
||||
<P><I>Copyright <A HREF="mailto:John_Maddock@compuserve.com">Dr John
|
||||
Maddock</A> 1998-2000 all rights reserved.</I> </P>
|
||||
</BODY>
|
||||
</HTML>
|
||||
}</pre>
|
||||
|
||||
<p>All the functions operate on structure <b>regex_t</b>, which
|
||||
exposes two public members: </p>
|
||||
|
||||
<p><b>unsigned int re_nsub</b> this is filled in by <b>regcomp</b>
|
||||
and indicates the number of sub-expressions contained in the
|
||||
regular expression. </p>
|
||||
|
||||
<p><b>const TCHAR* re_endp</b> points to the end of the
|
||||
expression to compile when the flag REG_PEND is set. </p>
|
||||
|
||||
<p><i>Footnote: regex_t is actually a #define - it is either
|
||||
regex_tA or regex_tW depending upon whether UNICODE is defined or
|
||||
not, TCHAR is either char or wchar_t again depending upon the
|
||||
macro UNICODE.</i> </p>
|
||||
|
||||
<p><b>regcomp</b> takes a pointer to a <b>regex_t</b>, a pointer
|
||||
to the expression to compile and a flags parameter which can be a
|
||||
combination of: <br>
|
||||
</p>
|
||||
|
||||
<table border="0" cellpadding="7" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td width="5%"> </td>
|
||||
<td valign="top" width="45%">REG_EXTENDED</td>
|
||||
<td valign="top" width="45%">Compiles modern regular
|
||||
expressions. Equivalent to regbase::char_classes |
|
||||
regbase::intervals | regbase::bk_refs.</td>
|
||||
<td width="5%"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="5%"> </td>
|
||||
<td valign="top" width="45%">REG_BASIC</td>
|
||||
<td valign="top" width="45%">Compiles basic (obsolete)
|
||||
regular expression syntax. Equivalent to regbase::char_classes
|
||||
| regbase::intervals | regbase::limited_ops | regbase::bk_braces
|
||||
| regbase::bk_parens | regbase::bk_refs.</td>
|
||||
<td width="5%"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="5%"> </td>
|
||||
<td valign="top" width="45%">REG_NOSPEC</td>
|
||||
<td valign="top" width="45%">All characters are ordinary,
|
||||
the expression is a literal string.</td>
|
||||
<td width="5%"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="5%"> </td>
|
||||
<td valign="top" width="45%">REG_ICASE</td>
|
||||
<td valign="top" width="45%">Compiles for matching that
|
||||
ignores character case.</td>
|
||||
<td width="5%"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="5%"> </td>
|
||||
<td valign="top" width="45%">REG_NOSUB</td>
|
||||
<td valign="top" width="45%">Has no effect in this
|
||||
library.</td>
|
||||
<td width="5%"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="5%"> </td>
|
||||
<td valign="top" width="45%">REG_NEWLINE</td>
|
||||
<td valign="top" width="45%">When this flag is set a dot
|
||||
does not match the newline character.</td>
|
||||
<td width="5%"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="5%"> </td>
|
||||
<td valign="top" width="45%">REG_PEND</td>
|
||||
<td valign="top" width="45%">When this flag is set the
|
||||
re_endp parameter of the regex_t structure must point to
|
||||
the end of the regular expression to compile.</td>
|
||||
<td width="5%"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="5%"> </td>
|
||||
<td valign="top" width="45%">REG_NOCOLLATE</td>
|
||||
<td valign="top" width="45%">When this flag is set then
|
||||
locale dependent collation for character ranges is turned
|
||||
off.</td>
|
||||
<td width="5%"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="5%"> </td>
|
||||
<td valign="top" width="45%">REG_ESCAPE_IN_LISTS<br>
|
||||
, , , </td>
|
||||
<td valign="top" width="45%">When this flag is set, then
|
||||
escape sequences are permitted in bracket expressions (character
|
||||
sets).</td>
|
||||
<td width="5%"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="5%"> </td>
|
||||
<td valign="top" width="45%">REG_NEWLINE_ALT </td>
|
||||
<td valign="top" width="45%">When this flag is set then
|
||||
the newline character is equivalent to the alternation
|
||||
operator |.</td>
|
||||
<td width="5%"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="5%"> </td>
|
||||
<td valign="top" width="45%">REG_PERL </td>
|
||||
<td valign="top" width="45%"> A shortcut for perl-like
|
||||
behavior: REG_EXTENDED | REG_NOCOLLATE |
|
||||
REG_ESCAPE_IN_LISTS</td>
|
||||
<td width="5%"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="5%"> </td>
|
||||
<td valign="top" width="45%">REG_AWK</td>
|
||||
<td valign="top" width="45%">A shortcut for awk-like
|
||||
behavior: REG_EXTENDED | REG_ESCAPE_IN_LISTS</td>
|
||||
<td width="5%"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="5%"> </td>
|
||||
<td valign="top" width="45%">REG_GREP</td>
|
||||
<td valign="top" width="45%">A shortcut for grep like
|
||||
behavior: REG_BASIC | REG_NEWLINE_ALT</td>
|
||||
<td width="5%"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="5%"> </td>
|
||||
<td valign="top" width="45%">REG_EGREP</td>
|
||||
<td valign="top" width="45%"> A shortcut for egrep
|
||||
like behavior: REG_EXTENDED | REG_NEWLINE_ALT</td>
|
||||
<td width="5%"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<p><br>
|
||||
</p>
|
||||
|
||||
<p><b>regerror</b> takes the following parameters, it maps an
|
||||
error code to a human readable string: <br>
|
||||
</p>
|
||||
|
||||
<table border="0" cellpadding="7" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td width="5%"> </td>
|
||||
<td valign="top" width="50%">int code</td>
|
||||
<td valign="top" width="50%">The error code.</td>
|
||||
<td width="5%"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td valign="top" width="50%">const regex_t* e</td>
|
||||
<td valign="top" width="50%">The regular expression (can
|
||||
be null).</td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td valign="top" width="50%">char* buf</td>
|
||||
<td valign="top" width="50%">The buffer to fill in with
|
||||
the error message.</td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td valign="top" width="50%">unsigned int buf_size</td>
|
||||
<td valign="top" width="50%">The length of buf.</td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<p>If the error code is OR'ed with REG_ITOA then the message that
|
||||
results is the printable name of the code rather than a message,
|
||||
for example "REG_BADPAT". If the code is REG_ATIO then <b>e</b>
|
||||
must not be null and <b>e->re_pend</b> must point to the
|
||||
printable name of an error code, the return value is then the
|
||||
value of the error code. For any other value of <b>code</b>, the
|
||||
return value is the number of characters in the error message, if
|
||||
the return value is greater than or equal to <b>buf_size</b> then
|
||||
<b>regerror</b> will have to be called again with a larger buffer.</p>
|
||||
|
||||
<p><b>regexec</b> finds the first occurrence of expression <b>e</b>
|
||||
within string <b>buf</b>. If <b>len</b> is non-zero then *<b>m</b>
|
||||
is filled in with what matched the regular expression, <b>m[0]</b>
|
||||
contains what matched the whole string, <b>m[1] </b>the first sub-expression
|
||||
etc, see <b>regmatch_t</b> in the header file declaration for
|
||||
more details. The <b>eflags</b> parameter can be a combination of:
|
||||
<br>
|
||||
</p>
|
||||
|
||||
<table border="0" cellpadding="7" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td width="5%"> </td>
|
||||
<td valign="top" width="50%">REG_NOTBOL</td>
|
||||
<td valign="top" width="50%">Parameter <b>buf </b>does
|
||||
not represent the start of a line.</td>
|
||||
<td width="5%"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td valign="top" width="50%">REG_NOTEOL</td>
|
||||
<td valign="top" width="50%">Parameter <b>buf</b> does
|
||||
not terminate at the end of a line.</td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td valign="top" width="50%">REG_STARTEND</td>
|
||||
<td valign="top" width="50%">The string searched starts
|
||||
at buf + pmatch[0].rm_so and ends at buf + pmatch[0].rm_eo.</td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<p><br>
|
||||
</p>
|
||||
|
||||
<p>Finally <b>regfree</b> frees all the memory that was allocated
|
||||
by regcomp. </p>
|
||||
|
||||
<p><i>Footnote: this is an abridged reference to the POSIX API
|
||||
functions, it is provided for compatibility with other libraries,
|
||||
rather than an API to be used in new code (unless you need access
|
||||
from a language other than C++). This version of these functions
|
||||
should also happily coexist with other versions, as the names
|
||||
used are macros that expand to the actual function names.</i> <br>
|
||||
</p>
|
||||
|
||||
<hr>
|
||||
|
||||
<p><i>Copyright </i><a href="mailto:John_Maddock@compuserve.com"><i>Dr
|
||||
John Maddock</i></a><i> 1998-2000 all rights reserved.</i> </p>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -16,7 +16,7 @@
|
||||
/*
|
||||
* LOCATION: see http://www.boost.org for most recent version.
|
||||
* FILE c_regex_traits.cpp
|
||||
* VERSION 3.12
|
||||
* VERSION see <boost/version.hpp>
|
||||
* DESCRIPTION: Implements the c_regex_traits<charT> traits class
|
||||
*/
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
/*
|
||||
* LOCATION: see http://www.boost.org for most recent version.
|
||||
* FILE: c_regex_traits_common.cpp
|
||||
* VERSION: 3.12
|
||||
* VERSION: see <boost/version.hpp>
|
||||
* DESCRIPTION: Implements common code and data for the
|
||||
* c_regex_traits<charT> traits classes.
|
||||
*/
|
||||
|
@ -16,7 +16,7 @@
|
||||
/*
|
||||
* LOCATION: see http://www.boost.org for most recent version.
|
||||
* FILE: c_regex_traits.cpp
|
||||
* VERSION: 3.12
|
||||
* VERSION: see <boost/version.hpp>
|
||||
* DESCRIPTION: Implements the cpp_regex_traits<charT> traits class
|
||||
*/
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
/*
|
||||
* LOCATION: see http://www.boost.org for most recent version.
|
||||
* FILE: cregex.cpp
|
||||
* VERSION: 3.12
|
||||
* VERSION: see <boost/version.hpp>
|
||||
* DESCRIPTION: Implements high level class boost::RexEx
|
||||
*/
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
/*
|
||||
* LOCATION: see http://www.boost.org for most recent version.
|
||||
* FILE: fileiter.cpp
|
||||
* VERSION: 3.12
|
||||
* VERSION: see <boost/version.hpp>
|
||||
* DESCRIPTION: Implements file io primitives + directory searching for class boost::RegEx.
|
||||
*/
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
/*
|
||||
* LOCATION: see http://www.boost.org for most recent version.
|
||||
* FILE: posix_api.cpp
|
||||
* VERSION: 3.12
|
||||
* VERSION: see <boost/version.hpp>
|
||||
* DESCRIPTION: Implements the Posix API wrappers.
|
||||
*/
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
/*
|
||||
* LOCATION: see http://www.boost.org for most recent version.
|
||||
* FILE: primary_transform.hpp
|
||||
* VERSION: 3.12
|
||||
* VERSION: see <boost/version.hpp>
|
||||
* DESCRIPTION: Heuristically determines the sort string format in use
|
||||
* by the current locale.
|
||||
*/
|
||||
|
@ -16,7 +16,7 @@
|
||||
/*
|
||||
* LOCATION: see http://www.boost.org for most recent version.
|
||||
* FILE: regex.cpp
|
||||
* VERSION: 3.12
|
||||
* VERSION: see <boost/version.hpp>
|
||||
* DESCRIPTION: Misc boost::regbase member funnctions.
|
||||
*/
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
/*
|
||||
* LOCATION: see http://www.boost.org for most recent version.
|
||||
* FILE: regex_debug.cpp
|
||||
* VERSION: 3.12
|
||||
* VERSION: see <boost/version.hpp>
|
||||
* DESCRIPTION: Misc. debugging helpers.
|
||||
*/
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
/*
|
||||
* LOCATION: see http://www.boost.org for most recent version.
|
||||
* FILE: regex_synch.cpp
|
||||
* VERSION: 3.12
|
||||
* VERSION: see <boost/version.hpp>
|
||||
* DESCRIPTION: Thread synch helper functions, for regular
|
||||
* expression library.
|
||||
*/
|
||||
|
@ -16,7 +16,7 @@
|
||||
/*
|
||||
* LOCATION: see http://www.boost.org for most recent version.
|
||||
* FILE: w32_regex_traits.cpp
|
||||
* VERSION: 3.12
|
||||
* VERSION: see <boost/version.hpp>
|
||||
* DESCRIPTION: Implements the w32_regex_traits<charT> traits class
|
||||
*/
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
/*
|
||||
* LOCATION: see http://www.boost.org for most recent version.
|
||||
* FILE: wide_posix_api.cpp
|
||||
* VERSION: 3.12
|
||||
* VERSION: see <boost/version.hpp>
|
||||
* DESCRIPTION: Implements the wide character POSIX API wrappers.
|
||||
*/
|
||||
|
||||
|
33
syntax.htm
33
syntax.htm
@ -15,23 +15,24 @@ content="C:\PROGRAM FILES\MICROSOFT OFFICE\OFFICE\html.dot">
|
||||
|
||||
<table border="0" cellpadding="7" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td valign="top" width="50%"><h3><img
|
||||
src="../../c++boost.gif" alt="C++ Boost" width="276"
|
||||
height="86"></h3>
|
||||
<td valign="top"><h3><img src="../../c++boost.gif"
|
||||
alt="C++ Boost" width="276" height="86"></h3>
|
||||
</td>
|
||||
<td valign="top" width="50%"><h3 align="center">Regex++,
|
||||
Regular Expression Syntax.</h3>
|
||||
<p><i>(version 3.12, 18 April 2000)</i> </p>
|
||||
<pre><i>Copyright (c) 1998-2000
|
||||
Dr John Maddock
|
||||
|
||||
Permission to use, copy, modify, distribute and sell this software
|
||||
and its documentation for any purpose is hereby granted without fee,
|
||||
provided that the above copyright notice appear in all copies and
|
||||
that both that copyright notice and this permission notice appear
|
||||
in supporting documentation. Dr John Maddock makes no representations
|
||||
about the suitability of this software for any purpose.
|
||||
It is provided "as is" without express or implied warranty.</i></pre>
|
||||
<td valign="top"><h3 align="center">Regex++, Regular
|
||||
Expression Syntax.</h3>
|
||||
<p align="left"><i>(Version 3.20, 29th Sept 2001)</i>
|
||||
</p>
|
||||
<p align="left"><i>Copyright (c) 1998-2001 </i></p>
|
||||
<p align="left"><i>Dr John Maddock</i></p>
|
||||
<p align="left"><i>Permission to use, copy, modify,
|
||||
distribute and sell this software and its documentation
|
||||
for any purpose is hereby granted without fee, provided
|
||||
that the above copyright notice appear in all copies and
|
||||
that both that copyright notice and this permission
|
||||
notice appear in supporting documentation. Dr John
|
||||
Maddock makes no representations about the suitability of
|
||||
this software for any purpose. It is provided "as is"
|
||||
without express or implied warranty.</i></p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
@ -13,25 +13,27 @@ content="C:\PROGRAM FILES\MICROSOFT OFFICE\OFFICE\html.dot">
|
||||
|
||||
<p> </p>
|
||||
|
||||
<table border="0" cellpadding="7" cellspacing="0" width="624">
|
||||
<table border="0" cellpadding="7" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td valign="top" width="50%"><h3 align="right"><img
|
||||
<td valign="top"><h3 align="right"><img
|
||||
src="../../c++boost.gif" alt="C++ Boost" width="276"
|
||||
height="86"></h3>
|
||||
</td>
|
||||
<td valign="top" width="50%"><h2 align="center">Regex++,
|
||||
Template Class and Algorithm Reference.</h2>
|
||||
<p><i>(version 3.12, 18 April 2000)</i> </p>
|
||||
<pre><i>Copyright (c) 1998-9
|
||||
Dr John Maddock
|
||||
|
||||
Permission to use, copy, modify, distribute and sell this software
|
||||
and its documentation for any purpose is hereby granted without fee,
|
||||
provided that the above copyright notice appear in all copies and
|
||||
that both that copyright notice and this permission notice appear
|
||||
in supporting documentation. Dr John Maddock makes no representations
|
||||
about the suitability of this software for any purpose.
|
||||
It is provided "as is" without express or implied warranty.</i></pre>
|
||||
<td valign="top"><h3 align="center"><i>Regex++ template
|
||||
class reference.</i></h3>
|
||||
<p align="left"><i>(Version 3.20, 29th Sept 2001)</i>
|
||||
</p>
|
||||
<p align="left"><i>Copyright (c) 1998-2001 </i></p>
|
||||
<p align="left"><i>Dr John Maddock</i></p>
|
||||
<p align="left"><i>Permission to use, copy, modify,
|
||||
distribute and sell this software and its documentation
|
||||
for any purpose is hereby granted without fee, provided
|
||||
that the above copyright notice appear in all copies and
|
||||
that both that copyright notice and this permission
|
||||
notice appear in supporting documentation. Dr John
|
||||
Maddock makes no representations about the suitability of
|
||||
this software for any purpose. It is provided "as is"
|
||||
without express or implied warranty.</i></p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -791,10 +793,10 @@ template <class charT> class regex_traits : public base_type { /*detailts*
|
||||
<p>Where "<i>base_type</i>" defaults to <i>w32_regex_traits</i>
|
||||
on Win32 systems, and <i>c_regex_traits</i> otherwise. The
|
||||
default behaviour can be changed by defining one of
|
||||
BOOST_REGEX_USE_C_LOCALE (forces use of <i>c_regex_traits</i> by default),
|
||||
or BOOST_REGEX_USE_CPP_LOCALE (forces use of <i>cpp_regex_traits</i> by
|
||||
default). Alternatively a specific traits class can be passed to
|
||||
the <i>reg_expression</i> template. </p>
|
||||
BOOST_REGEX_USE_C_LOCALE (forces use of <i>c_regex_traits</i> by
|
||||
default), or BOOST_REGEX_USE_CPP_LOCALE (forces use of <i>cpp_regex_traits</i>
|
||||
by default). Alternatively a specific traits class can be passed
|
||||
to the <i>reg_expression</i> template. </p>
|
||||
|
||||
<p>The requirements for custom traits classes are <a
|
||||
href="traits_class_ref.htm">documented separately here....</a> </p>
|
||||
|
@ -16,7 +16,7 @@
|
||||
/*
|
||||
* LOCATION: see http://www.boost.org for most recent version.
|
||||
* FILE posix_api_compiler_check.c
|
||||
* VERSION 3.01
|
||||
* VERSION see <boost/version.hpp>
|
||||
* DESCRIPTION: Verify that POSIX API calls compile: note this is a compile
|
||||
* time check only.
|
||||
*/
|
||||
|
@ -16,7 +16,7 @@
|
||||
/*
|
||||
* LOCATION: see http://www.boost.org for most recent version.
|
||||
* FILE posix_api_compiler_check.c
|
||||
* VERSION 3.01
|
||||
* VERSION see <boost/version.hpp>
|
||||
* DESCRIPTION: Verify that POSIX API calls compile: note this is a compile
|
||||
* time check only.
|
||||
*/
|
||||
|
@ -16,7 +16,7 @@
|
||||
/*
|
||||
* LOCATION: see http://www.boost.org for most recent version.
|
||||
* FILE wide_posix_api_compiler_check.c
|
||||
* VERSION 3.01
|
||||
* VERSION see <boost/version.hpp>
|
||||
* DESCRIPTION: Verify that POSIX API calls compile: note this is a compile
|
||||
* time check only.
|
||||
*/
|
||||
|
@ -16,7 +16,7 @@
|
||||
/*
|
||||
* LOCATION: see http://www.boost.org for most recent version.
|
||||
* FILE wide_posix_api_compiler_check.c
|
||||
* VERSION 3.01
|
||||
* VERSION see <boost/version.hpp>
|
||||
* DESCRIPTION: Verify that POSIX API calls compile: note this is a compile
|
||||
* time check only.
|
||||
*/
|
||||
|
@ -16,7 +16,7 @@
|
||||
/*
|
||||
*
|
||||
* FILE parse.cpp
|
||||
* VERSION 3.12
|
||||
* VERSION see <boost/version.hpp>
|
||||
*
|
||||
* Input parsing functions for regress.
|
||||
*
|
||||
|
@ -16,7 +16,7 @@
|
||||
/*
|
||||
* LOCATION: see http://www.boost.org for most recent version.
|
||||
* FILE regex_test.cpp
|
||||
* VERSION 3.12
|
||||
* VERSION see <boost/version.hpp>
|
||||
* DESCRIPTION: Builds regression test program with default
|
||||
* locale and narrow character tests. Also
|
||||
* instantiates all the templates in the library
|
||||
|
@ -16,7 +16,7 @@
|
||||
/*
|
||||
*
|
||||
* FILE regress.cpp
|
||||
* VERSION 3.12
|
||||
* VERSION see <boost/version.hpp>
|
||||
*
|
||||
* main() and associated code for regress.
|
||||
*
|
||||
|
@ -16,7 +16,7 @@
|
||||
/*
|
||||
*
|
||||
* FILE regress.h
|
||||
* VERSION 3.12
|
||||
* VERSION see <boost/version.hpp>
|
||||
*
|
||||
* Function and data declarations for regress.
|
||||
*
|
||||
|
@ -16,7 +16,7 @@
|
||||
/*
|
||||
*
|
||||
* FILE tests.cpp
|
||||
* VERSION 3.12
|
||||
* VERSION see <boost/version.hpp>
|
||||
*
|
||||
* the actual tests conducted by regress.
|
||||
*
|
||||
|
@ -16,7 +16,7 @@
|
||||
/*
|
||||
* LOCATION: see http://www.boost.org for most recent version.
|
||||
* FILE regex_test.cpp
|
||||
* VERSION 3.12
|
||||
* VERSION see <boost/version.hpp>
|
||||
* DESCRIPTION: Builds regression test program with default
|
||||
* locale and wide character tests. Also
|
||||
* instantiates all the templates in the library
|
||||
|
1638
traits_class_ref.htm
1638
traits_class_ref.htm
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user