forked from boostorg/regex
164 lines
8.9 KiB
HTML
164 lines
8.9 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
|
<html>
|
|
<head>
|
|
<title>Boost.Regex: Configuration and setup</title>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
|
<link rel="stylesheet" type="text/css" href="../../../boost.css">
|
|
</head>
|
|
<body>
|
|
<P>
|
|
<TABLE id="Table1" cellSpacing="1" cellPadding="1" width="100%" border="0">
|
|
<TR>
|
|
<td valign="top" width="300">
|
|
<h3><a href="../../../index.htm"><img height="86" width="277" alt="C++ Boost" src="../../../c++boost.gif" border="0"></a></h3>
|
|
</td>
|
|
<TD width="353">
|
|
<H1 align="center">Boost.Regex</H1>
|
|
<H2 align="center">Configuration and setup</H2>
|
|
</TD>
|
|
<td width="50">
|
|
<h3><a href="index.html"><img height="45" width="43" alt="Boost.Regex Index" src="uarrow.gif" border="0"></a></h3>
|
|
</td>
|
|
</TR>
|
|
</TABLE>
|
|
</P>
|
|
<HR>
|
|
<h2>Contents</h2>
|
|
<dl class="index">
|
|
<dt><a href="#compiler">Compiler setup</a></dt>
|
|
<dt><a href="#locale">Locale and traits class selection</a></dt>
|
|
<dt><a href="#linkage">Linkage Options</a></dt>
|
|
<dt><a href="#algorithm">Algorithm Selection</a></dt>
|
|
<dt><a href="#tuning">Algorithm Tuning</a></dt>
|
|
</dl>
|
|
<H3><A name="compiler"></A>Compiler setup.</H3>
|
|
<P>You shouldn't need to do anything special to configure boost.regex for use with
|
|
your compiler - the <A href="../../config/index.html">boost.config</A> subsystem
|
|
should already take care of it, if you do have problems (or you are using a
|
|
particularly obscure compiler or platform) then <A href="../../config/index.html">boost.config</A> has
|
|
a <A href="../../config/config.htm#config_script">configure</A> script.</P>
|
|
<H3><A name="locale"></A>Locale and traits class selection.</H3>
|
|
<P>The following macros (see <A href="../../../boost/regex/user.hpp">user.hpp</A>)
|
|
control how boost.regex interacts with the users locale:</P>
|
|
<P>
|
|
<TABLE id="Table2" cellSpacing="1" cellPadding="1" width="100%" border="1">
|
|
<TR>
|
|
<TD width="265">BOOST_REGEX_USE_C_LOCALE</TD>
|
|
<TD>Forces boost.regex to use the global C locale in it's traits class support:
|
|
this is the default behaviour on non-windows platforms, but MS Windows
|
|
platforms normally use the Win32 API for locale support.</TD>
|
|
</TR>
|
|
<TR>
|
|
<TD width="265">BOOST_REGEX_USE_CPP_LOCALE</TD>
|
|
<TD>Forces boost.regex to use std::locale in it's default traits class, regular
|
|
expressions can then be imbued with an instance specific locale.</TD>
|
|
</TR>
|
|
<TR>
|
|
<TD width="265">BOOST_REGEX_NO_W32</TD>
|
|
<TD>Tells boost.regex not to use any Win32 API's even when available (implies
|
|
BOOST_REGEX_USE_C_LOCALE unless BOOST_REGEX_USE_CPP_LOCALE is set).</TD>
|
|
</TR>
|
|
</TABLE>
|
|
</P>
|
|
<H3><A name="linkage"></A>Linkage Options</H3>
|
|
<P>
|
|
<TABLE id="Table3" cellSpacing="1" cellPadding="1" width="100%" border="1">
|
|
<TR>
|
|
<TD>BOOST_REGEX_STATIC_LINK</TD>
|
|
<TD>For Microsoft and Borland C++ builds, this tells boost.regex that it is going
|
|
to be linked to a static library even when using a dynamic C runtime.</TD>
|
|
</TR>
|
|
<TR>
|
|
<TD>BOOST_REGEX_NO_LIB</TD>
|
|
<TD>For Microsoft and Borland C++ builds, this tells boost.regex that it should
|
|
not automatically select the library to link to.</TD>
|
|
</TR>
|
|
</TABLE>
|
|
</P>
|
|
<H3><A name="algorithm"></A>Algorithm Selection</H3>
|
|
<P>
|
|
<TABLE id="Table4" cellSpacing="1" cellPadding="1" width="100%" border="1">
|
|
<TR>
|
|
<TD width="253">BOOST_REGEX_V3</TD>
|
|
<TD>Tells boost.regex to use the boost-1.30.0 matching algorithm, define only if
|
|
you need maximum compatibility with previous behaviour.</TD>
|
|
</TR>
|
|
<TR>
|
|
<TD width="253">BOOST_REGEX_RECURSIVE</TD>
|
|
<TD>Tells boost.regex to use a stack-recursive matching algorithm. This is
|
|
generally the fastest option (although there is very little in it), but can
|
|
cause stack overflow in extreme cases, on Win32 this can be handled safely, but
|
|
this is not the case on other platforms.</TD>
|
|
</TR>
|
|
<TR>
|
|
<TD width="253">BOOST_REGEX_NON_RECURSIVE</TD>
|
|
<TD>Tells boost.regex to use a non-stack recursive matching algorithm, this can be
|
|
slightly slower than the alternative, but is always safe no matter how
|
|
pathological the regular expression. This is the default on non-Win32
|
|
platforms.</TD>
|
|
</TR>
|
|
</TABLE>
|
|
</P>
|
|
<H3><A name="tuning"></A>Algorithm Tuning</H3>
|
|
<P>The following option applies only if BOOST_REGEX_RECURSIVE is set.</P>
|
|
<P>
|
|
<TABLE id="Table6" cellSpacing="1" cellPadding="1" width="100%" border="1">
|
|
<TR>
|
|
<TD>BOOST_REGEX_HAS_MS_STACK_GUARD</TD>
|
|
<TD>Tells boost.regex that Microsoft style __try - __except blocks are supported,
|
|
and can be used to safely trap stack overflow.</TD>
|
|
</TR>
|
|
</TABLE>
|
|
</P>
|
|
<P>The following options apply only if BOOST_REGEX_NON_RECURSIVE is set.</P>
|
|
<P>
|
|
<TABLE id="Table5" cellSpacing="1" cellPadding="1" width="100%" border="1">
|
|
<TR>
|
|
<TD>BOOST_REGEX_BLOCKSIZE</TD>
|
|
<TD>In non-recursive mode, boost.regex uses largish blocks of memory to act as a
|
|
stack for the state machine, the larger the block size then the fewer
|
|
allocations that will take place. This defaults to 4096 bytes, which is
|
|
large enough to match the vast majority of regular expressions without
|
|
further allocations, however, you can choose smaller or larger values depending
|
|
upon your platforms characteristics.</TD>
|
|
</TR>
|
|
<TR>
|
|
<TD>BOOST_REGEX_MAX_BLOCKS</TD>
|
|
<TD>Tells boost.regex how many blocks of size BOOST_REGEX_BLOCKSIZE it is
|
|
permitted to use. If this value is exceeded then boost.regex will stop
|
|
trying to find a match and throw a std::runtime_error. Defaults to 1024,
|
|
don't forget to tweek this value if you alter BOOST_REGEX_BLOCKSIZE by much.</TD>
|
|
</TR>
|
|
<TR>
|
|
<TD>BOOST_REGEX_MAX_CACHE_BLOCKS</TD>
|
|
<TD>Tells boost.regex how many memory blocks to store in it's internal cache -
|
|
memory blocks are taken from this cache rather than by calling ::operator
|
|
new. Generally speeking this can be an order of magnitude faster than
|
|
calling ::opertator new each time a memory block is required, but has the
|
|
downside that boost.regex can end up caching a large chunk of memory (by
|
|
default up to 16 blocks each of BOOST_REGEX_BLOCKSIZE size). If memory is
|
|
tight then try defining this to 0 (disables all caching), or if that is too
|
|
slow, then a value of 1 or 2, may be sufficient. On the other hand, on
|
|
large multi-processor, multi-threaded systems, you may find that a higher value
|
|
is in order.</TD>
|
|
</TR>
|
|
</TABLE>
|
|
</P>
|
|
<P>
|
|
<HR>
|
|
<P></P>
|
|
<p>Revised
|
|
<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->
|
|
11 April 2003
|
|
<!--webbot bot="Timestamp" endspan i-checksum="39359" -->
|
|
</p>
|
|
<P><I>© Copyright <a href="mailto:jm@regex.fsnet.co.uk">John Maddock</a> 1998-<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%Y" startspan --> 2003<!--webbot bot="Timestamp" endspan i-checksum="39359" --></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>
|
|
</body>
|
|
</html>
|