mirror of
https://github.com/boostorg/regex.git
synced 2026-04-29 02:03:38 +02:00
Merge branch 'develop'
This commit is contained in:
+16
-1
@@ -115,7 +115,21 @@ if ! $(disable-icu)
|
||||
|
||||
}
|
||||
|
||||
exe has_icu : ./has_icu_test.cpp : $(ICU_OPTS) ;
|
||||
actions regex_simple_run_action
|
||||
{
|
||||
$(>) > $(<)
|
||||
}
|
||||
|
||||
rule regex-run-simple ( sources + : args * : input-files * : requirements * : target-name )
|
||||
{
|
||||
exe $(target-name)_exe : $(sources) : $(requirements) ;
|
||||
explicit $(target-name)_exe ;
|
||||
make $(target-name).output : $(target-name)_exe : @regex_simple_run_action ;
|
||||
explicit $(target-name).output ;
|
||||
alias $(target-name) : $(target-name).output ;
|
||||
}
|
||||
|
||||
regex-run-simple has_icu_test.cpp : : : $(ICU_OPTS) : has_icu ;
|
||||
explicit has_icu ;
|
||||
|
||||
alias icu_options : : : : [ check-target-builds has_icu : $(ICU_OPTS) : ] ;
|
||||
@@ -146,6 +160,7 @@ lib boost_regex : ../src/$(SOURCES) icu_options
|
||||
#<toolset>gcc-mw:<link>static
|
||||
#<toolset>gcc-mingw:<link>static
|
||||
<toolset>gcc-cygwin:<link>static
|
||||
<toolset>sun:<link>static
|
||||
;
|
||||
|
||||
boost-install boost_regex ;
|
||||
|
||||
+14
-2
@@ -13,6 +13,9 @@
|
||||
#include <unicode/utypes.h>
|
||||
#include <unicode/uchar.h>
|
||||
#include <unicode/coll.h>
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
#include <iostream>
|
||||
#include <iomanip>
|
||||
|
||||
#if defined(_MSC_VER) && !defined(_DLL)
|
||||
#error "Mixing ICU with a static runtime doesn't work"
|
||||
@@ -20,7 +23,16 @@
|
||||
|
||||
int main()
|
||||
{
|
||||
// To detect possible binary mismatches between the installed ICU build, and whatever
|
||||
// C++ std lib's we're using, we need to:
|
||||
// * Make sure we call ICU C++ API's
|
||||
// * Make sure we call std lib C++ API's as well (cout).
|
||||
// * Be sure this program is run, not just built.
|
||||
UErrorCode err = U_ZERO_ERROR;
|
||||
UChar32 c = ::u_charFromName(U_UNICODE_CHAR_NAME, "GREEK SMALL LETTER ALPHA", &err);
|
||||
return err;
|
||||
}
|
||||
std::cout << (int)c << std::endl;
|
||||
if(err > 0) return err;
|
||||
U_NAMESPACE_QUALIFIER Locale l;
|
||||
boost::scoped_ptr<U_NAMESPACE_QUALIFIER Collator> p_col(U_NAMESPACE_QUALIFIER Collator::createInstance(l, err));
|
||||
return err > 0 ? err : 0;
|
||||
}
|
||||
|
||||
+1
-1
@@ -142,7 +142,7 @@ example program shows how this information may be used:
|
||||
Which produces the following output:
|
||||
|
||||
[pre
|
||||
Expression: "(([[:lower:\]\]+)|([[:upper:\]\]+))+"
|
||||
Expression: "((\[\[:lower:\]\]+)|(\[\[:upper:\]\]+))+"
|
||||
Text: "aBBcccDDDDDeeeeeeee"
|
||||
'''**''' Match found '''**'''
|
||||
Sub-Expressions:
|
||||
|
||||
+32
-8
@@ -58,16 +58,40 @@ an object of type `X::locale_type`.
|
||||
[[X::size_type][][An unsigned integer type, capable of holding the length of a null-terminated string of charT's.]]
|
||||
[[X::string_type][std::basic_string<charT> or std::vector<charT>][]]
|
||||
[[X::locale_type][Implementation defined][A copy constructible type that represents the locale used by the traits class.]]
|
||||
[[X::char_class_type][Implementation defined][A bitmask type representing a particular character classification. Multiple values of this type can be bitwise-or'ed together to obtain a new valid value.]]
|
||||
[[X::char_class_type]
|
||||
[Implementation defined]
|
||||
[A bitmask type representing a particular character classification. Multiple values of this type can be bitwise-or'ed together to obtain a new valid value.]]
|
||||
[[X::length(p)][X::size_type][Yields the smallest i such that p\[i\] == 0. Complexity is linear in i.]]
|
||||
[[v.translate(c)][X::char_type][Returns a character such that for any character d that is to be considered equivalent to c then v.translate(c) == v.translate(d).]]
|
||||
[[v.translate_nocase(c)][X::char_type][For all characters C that are to be considered equivalent to c when comparisons are to be performed without regard to case, then v.translate_nocase(c) == v.translate_nocase(C).]]
|
||||
[[v.transform(F1, F2)][X::string_type][Returns a sort key for the character sequence designated by the iterator range \[F1, F2) such that if the character sequence \[G1, G2) sorts before the character sequence [H1, H2) then v.transform(G1, G2) < v.transform(H1, H2). ]]
|
||||
[[v.transform_primary(F1, F2)][X::string_type][Returns a sort key for the character sequence designated by the iterator range \[F1, F2) such that if the character sequence [G1, G2) sorts before the character sequence \[H1, H2) when character case is not considered then v.transform_primary(G1, G2) < v.transform_primary(H1, H2).]]
|
||||
[[v.lookup_classname(F1, F2)][X::char_class_type][Converts the character sequence designated by the iterator range \[F1,F2) into a bitmask type that can subsequently be passed to isctype. Values returned from lookup_classname can be safely bitwise or'ed together. Returns 0 if the character sequence is not the name of a character class recognized by X. The value returned shall be independent of the case of the characters in the sequence.]]
|
||||
[[v.lookup_collatename(F1, F2)][X::string_type][Returns a sequence of characters that represents the collating element consisting of the character sequence designated by the iterator range \[F1, F2). Returns an empty string if the character sequence is not a valid collating element.]]
|
||||
[[v.translate(c)]
|
||||
[X::char_type]
|
||||
[Returns a character such that for any character d that is to be considered equivalent to c then v.translate(c) == v.translate(d).]]
|
||||
[[v.translate_nocase(c)]
|
||||
[X::char_type]
|
||||
[For all characters C that are to be considered equivalent to c when comparisons are to be performed without regard to case, then v.translate_nocase(c) == v.translate_nocase(C).]]
|
||||
[[v.transform(F1, F2)]
|
||||
[X::string_type]
|
||||
[Returns a sort key for the character sequence designated by the iterator range \[F1, F2) such that if
|
||||
the character sequence \[G1, G2) sorts before the character sequence \[H1, H2) then
|
||||
v.transform(G1, G2) < v.transform(H1, H2). ]]
|
||||
[[v.transform_primary(F1, F2)]
|
||||
[X::string_type]
|
||||
[Returns a sort key for the character sequence designated by the iterator range \[F1, F2) such that if the
|
||||
character sequence \[G1, G2) sorts before the character sequence \[H1, H2) when character case is not considered
|
||||
then v.transform_primary(G1, G2) < v.transform_primary(H1, H2).]]
|
||||
[[v.lookup_classname(F1, F2)]
|
||||
[X::char_class_type]
|
||||
[Converts the character sequence designated by the iterator range \[F1,F2) into a bitmask type that can subsequently
|
||||
be passed to isctype. Values returned from lookup_classname can be safely bitwise or'ed together. Returns 0 if the
|
||||
character sequence is not the name of a character class recognized by X. The value returned shall be independent
|
||||
of the case of the characters in the sequence.]]
|
||||
[[v.lookup_collatename(F1, F2)]
|
||||
[X::string_type]
|
||||
[Returns a sequence of characters that represents the collating element consisting of the character sequence designated
|
||||
by the iterator range \[F1, F2). Returns an empty string if the character sequence is not a valid collating element.]]
|
||||
[[v.isctype(c, v.lookup_classname (F1, F2))][bool][Returns true if character c is a member of the character class designated by the iterator range \[F1, F2), false otherwise.]]
|
||||
[[v.value(c, I)][int][Returns the value represented by the digit c in base I if the character c is a valid digit in base I; otherwise returns -1. \[Note: the value of I will only be 8, 10, or 16. -end note\]]]
|
||||
[[v.value(c, I)]
|
||||
[int]
|
||||
[Returns the value represented by the digit c in base I if the character c is a valid digit in base I; otherwise returns -1. \[Note: the value of I will only be 8, 10, or 16. -end note\]]]
|
||||
[[u.imbue(loc)][X::locale_type][Imbues u with the locale loc, returns the previous locale used by u if any. ]]
|
||||
[[v.getloc()][X::locale_type][Returns the current locale used by v if any. ]]
|
||||
]
|
||||
|
||||
@@ -1,543 +0,0 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
|
||||
<html>
|
||||
<head>
|
||||
<title>Regular Expression Performance Comparison (gcc 3.2)</title>
|
||||
<meta name="generator" content="HTML Tidy, see www.w3.org">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
|
||||
<META content="C:\PROGRAM FILES\MICROSOFT OFFICE\OFFICE\html.dot" name="Template">
|
||||
<meta name="GENERATOR" content="Microsoft FrontPage Express 2.0">
|
||||
</head>
|
||||
<body bgcolor="#ffffff" link="#0000ff" vlink="#800080">
|
||||
<h2>Regular Expression Performance Comparison</h2>
|
||||
<p>The following tables provide comparisons between the following regular
|
||||
expression libraries:</p>
|
||||
<p><a href="http://www.boost.org/">The Boost regex library</a>.</p>
|
||||
<p><a href="http://www.gnu.org">The GNU regular expression library</a>.</p>
|
||||
<p>Philip Hazel's <a href="http://www.pcre.org">PCRE</a> library.</p>
|
||||
<h3>Details</h3>
|
||||
<p>Machine: Intel Pentium 4 2.8GHz PC.</p>
|
||||
<p>Compiler: GNU C++ version 3.2 20020927 (prerelease).</p>
|
||||
<p>C++ Standard Library: GNU libstdc++ version 20020927.</p>
|
||||
<p>OS: Cygwin.</p>
|
||||
<p>Boost version: 1.31.0.</p>
|
||||
<p>PCRE version: 4.1.</p>
|
||||
<p>As ever care should be taken in interpreting the results, only sensible regular
|
||||
expressions (rather than pathological cases) are given, most are taken from the
|
||||
Boost regex examples, or from the <a href="http://www.regxlib.com/">Library of
|
||||
Regular Expressions</a>. In addition, some variation in the relative
|
||||
performance of these libraries can be expected on other machines - as memory
|
||||
access and processor caching effects can be quite large for most finite state
|
||||
machine algorithms. In each case the first figure given is the relative time
|
||||
taken (so a value of 1.0 is as good as it gets), while the second figure is the
|
||||
actual time taken.</p>
|
||||
<h3>Averages</h3>
|
||||
<p>The following are the average relative scores for all the tests: the perfect
|
||||
regular expression library would score 1, in practice anything less than 2
|
||||
is pretty good.</p>
|
||||
<table border="1" cellspacing="1">
|
||||
<tr>
|
||||
<td><strong>Boost</strong></td>
|
||||
<td><strong>Boost + C++ locale</strong></td>
|
||||
<td><strong>POSIX</strong></td>
|
||||
<td><strong>PCRE</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>1.4503</td>
|
||||
<td>1.49124</td>
|
||||
<td>108.372</td>
|
||||
<td>1.56255</td>
|
||||
</tr>
|
||||
</table>
|
||||
<br>
|
||||
<br>
|
||||
<h3>Comparison 1: Long Search</h3>
|
||||
<p>For each of the following regular expressions the time taken to find all
|
||||
occurrences of the expression within a long English language text was measured
|
||||
(<a href="http://www.gutenberg.org/files/3200/old/mtent12.zip">mtent12.txt</a>
|
||||
from <a href="http://promo.net/pg/">Project Gutenberg</a>, 19Mb). </p>
|
||||
<table border="1" cellspacing="1">
|
||||
<tr>
|
||||
<td><strong>Expression</strong></td>
|
||||
<td><strong>Boost</strong></td>
|
||||
<td><strong>Boost + C++ locale</strong></td>
|
||||
<td><strong>POSIX</strong></td>
|
||||
<td><strong>PCRE</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>Twain</code></td>
|
||||
<td>3.49<br>
|
||||
(0.205s)</td>
|
||||
<td>4.09<br>
|
||||
(0.24s)</td>
|
||||
<td>65.2<br>
|
||||
(3.83s)</td>
|
||||
<td><font color="#008000">1<br>
|
||||
(0.0588s)</font></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>Huck[[:alpha:]]+</code></td>
|
||||
<td>3.86<br>
|
||||
(0.203s)</td>
|
||||
<td>4.52<br>
|
||||
(0.238s)</td>
|
||||
<td>100<br>
|
||||
(5.26s)</td>
|
||||
<td><font color="#008000">1<br>
|
||||
(0.0526s)</font></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>[[:alpha:]]+ing</code></td>
|
||||
<td><font color="#008000">1.01<br>
|
||||
(1.23s)</font></td>
|
||||
<td><font color="#008000">1<br>
|
||||
(1.22s)</font></td>
|
||||
<td>4.95<br>
|
||||
(6.04s)</td>
|
||||
<td>4.67<br>
|
||||
(5.71s)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>^[^ ]*?Twain</code></td>
|
||||
<td><font color="#008000">1<br>
|
||||
(0.31s)</font></td>
|
||||
<td><font color="#008000">1.05<br>
|
||||
(0.326s)</font></td>
|
||||
<td>NA</td>
|
||||
<td>3.32<br>
|
||||
(1.03s)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>Tom|Sawyer|Huckleberry|Finn</code></td>
|
||||
<td><font color="#008000">1.02<br>
|
||||
(0.125s)</font></td>
|
||||
<td><font color="#008000">1<br>
|
||||
(0.123s)</font></td>
|
||||
<td>165<br>
|
||||
(20.3s)</td>
|
||||
<td><font color="#008000">1.08<br>
|
||||
(0.133s)</font></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code> (Tom|Sawyer|Huckleberry|Finn).{0,30}river|river.{0,30}(Tom|Sawyer|Huckleberry|Finn)</code></td>
|
||||
<td><font color="#008000">1<br>
|
||||
(0.345s)</font></td>
|
||||
<td><font color="#008000">1.03<br>
|
||||
(0.355s)</font></td>
|
||||
<td>NA</td>
|
||||
<td>1.71<br>
|
||||
(0.59s)</td>
|
||||
</tr>
|
||||
</table>
|
||||
<br>
|
||||
<br>
|
||||
<h3>Comparison 2: Medium Sized Search</h3>
|
||||
<p>For each of the following regular expressions the time taken to find all
|
||||
occurrences of the expression within a medium sized English language text was
|
||||
measured (the first 50K from mtent12.txt). </p>
|
||||
<table border="1" cellspacing="1">
|
||||
<tr>
|
||||
<td><strong>Expression</strong></td>
|
||||
<td><strong>Boost</strong></td>
|
||||
<td><strong>Boost + C++ locale</strong></td>
|
||||
<td><strong>POSIX</strong></td>
|
||||
<td><strong>PCRE</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>Twain</code></td>
|
||||
<td>1.8<br>
|
||||
(0.000519s)</td>
|
||||
<td>2.14<br>
|
||||
(0.000616s)</td>
|
||||
<td>9.08<br>
|
||||
(0.00262s)</td>
|
||||
<td><font color="#008000">1<br>
|
||||
(0.000289s)</font></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>Huck[[:alpha:]]+</code></td>
|
||||
<td>3.65<br>
|
||||
(0.000499s)</td>
|
||||
<td>4.36<br>
|
||||
(0.000597s)</td>
|
||||
<td><font color="#008000">1<br>
|
||||
(0.000137s)</font></td>
|
||||
<td>1.43<br>
|
||||
(0.000196s)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>[[:alpha:]]+ing</code></td>
|
||||
<td><font color="#008000">1<br>
|
||||
(0.00258s)</font></td>
|
||||
<td><font color="#008000">1<br>
|
||||
(0.00258s)</font></td>
|
||||
<td>5.28<br>
|
||||
(0.0136s)</td>
|
||||
<td>5.63<br>
|
||||
(0.0145s)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>^[^ ]*?Twain</code></td>
|
||||
<td><font color="#008000">1<br>
|
||||
(0.000929s)</font></td>
|
||||
<td><font color="#008000">1.03<br>
|
||||
(0.000957s)</font></td>
|
||||
<td>NA</td>
|
||||
<td>2.82<br>
|
||||
(0.00262s)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>Tom|Sawyer|Huckleberry|Finn</code></td>
|
||||
<td><font color="#008000">1<br>
|
||||
(0.000812s)</font></td>
|
||||
<td><font color="#008000">1<br>
|
||||
(0.000812s)</font></td>
|
||||
<td>60.1<br>
|
||||
(0.0488s)</td>
|
||||
<td>1.28<br>
|
||||
(0.00104s)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code> (Tom|Sawyer|Huckleberry|Finn).{0,30}river|river.{0,30}(Tom|Sawyer|Huckleberry|Finn)</code></td>
|
||||
<td><font color="#008000">1.02<br>
|
||||
(0.00178s)</font></td>
|
||||
<td><font color="#008000">1<br>
|
||||
(0.00174s)</font></td>
|
||||
<td>242<br>
|
||||
(0.421s)</td>
|
||||
<td>1.3<br>
|
||||
(0.00227s)</td>
|
||||
</tr>
|
||||
</table>
|
||||
<br>
|
||||
<br>
|
||||
<h3>Comparison 3: C++ Code Search</h3>
|
||||
<p>For each of the following regular expressions the time taken to find all
|
||||
occurrences of the expression within the C++ source file <a href="../../../boost/crc.hpp">
|
||||
boost/crc.hpp</a> was measured. </p>
|
||||
<table border="1" cellspacing="1">
|
||||
<tr>
|
||||
<td><strong>Expression</strong></td>
|
||||
<td><strong>Boost</strong></td>
|
||||
<td><strong>Boost + C++ locale</strong></td>
|
||||
<td><strong>POSIX</strong></td>
|
||||
<td><strong>PCRE</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code> ^(template[[:space:]]*<[^;:{]+>[[:space:]]*)?(class|struct)[[:space:]]*(\<\w+\>([
|
||||
]*\([^)]*\))?[[:space:]]*)*(\<\w*\>)[[:space:]]*(<[^;:{]+>[[:space:]]*)?(\{|:[^;\{()]*\{)</code></td>
|
||||
<td><font color="#008000">1.04<br>
|
||||
(0.000144s)</font></td>
|
||||
<td><font color="#008000">1<br>
|
||||
(0.000139s)</font></td>
|
||||
<td>862<br>
|
||||
(0.12s)</td>
|
||||
<td>4.56<br>
|
||||
(0.000636s)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>(^[
|
||||
]*#(?:[^\\\n]|\\[^\n_[:punct:][:alnum:]]*[\n[:punct:][:word:]])*)|(//[^\n]*|/\*.*?\*/)|\<([+-]?(?:(?:0x[[:xdigit:]]+)|(?:(?:[[:digit:]]*\.)?[[:digit:]]+(?:[eE][+-]?[[:digit:]]+)?))u?(?:(?:int(?:8|16|32|64))|L)?)\>|('(?:[^\\']|\\.)*'|"(?:[^\\"]|\\.)*")|\<(__asm|__cdecl|__declspec|__export|__far16|__fastcall|__fortran|__import|__pascal|__rtti|__stdcall|_asm|_cdecl|__except|_export|_far16|_fastcall|__finally|_fortran|_import|_pascal|_stdcall|__thread|__try|asm|auto|bool|break|case|catch|cdecl|char|class|const|const_cast|continue|default|delete|do|double|dynamic_cast|else|enum|explicit|extern|false|float|for|friend|goto|if|inline|int|long|mutable|namespace|new|operator|pascal|private|protected|public|register|reinterpret_cast|return|short|signed|sizeof|static|static_cast|struct|switch|template|this|throw|true|try|typedef|typeid|typename|union|unsigned|using|virtual|void|volatile|wchar_t|while)\></code></td>
|
||||
<td><font color="#008000">1<br>
|
||||
(0.0139s)</font></td>
|
||||
<td><font color="#008000">1.01<br>
|
||||
(0.0141s)</font></td>
|
||||
<td>NA</td>
|
||||
<td>1.55<br>
|
||||
(0.0216s)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>^[ ]*#[ ]*include[ ]+("[^"]+"|<[^>]+>)</code></td>
|
||||
<td><font color="#008000">1.04<br>
|
||||
(0.000332s)</font></td>
|
||||
<td><font color="#008000">1<br>
|
||||
(0.000318s)</font></td>
|
||||
<td>130<br>
|
||||
(0.0413s)</td>
|
||||
<td>1.72<br>
|
||||
(0.000547s)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>^[ ]*#[ ]*include[ ]+("boost/[^"]+"|<boost/[^>]+>)</code></td>
|
||||
<td><font color="#008000">1.02<br>
|
||||
(0.000323s)</font></td>
|
||||
<td><font color="#008000">1<br>
|
||||
(0.000318s)</font></td>
|
||||
<td>150<br>
|
||||
(0.0476s)</td>
|
||||
<td>1.72<br>
|
||||
(0.000547s)</td>
|
||||
</tr>
|
||||
</table>
|
||||
<br>
|
||||
<h3></h3>
|
||||
<H3>Comparison 4: HTML Document Search
|
||||
</H3>
|
||||
<p>For each of the following regular expressions the time taken to find all
|
||||
occurrences of the expression within the html file <a href="../../libraries.htm">libs/libraries.htm</a>
|
||||
was measured. </p>
|
||||
<table border="1" cellspacing="1">
|
||||
<tr>
|
||||
<td><strong>Expression</strong></td>
|
||||
<td><strong>Boost</strong></td>
|
||||
<td><strong>Boost + C++ locale</strong></td>
|
||||
<td><strong>POSIX</strong></td>
|
||||
<td><strong>PCRE</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>beman|john|dave</code></td>
|
||||
<td><font color="#008000">1.03<br>
|
||||
(0.000367s)</font></td>
|
||||
<td><font color="#008000">1<br>
|
||||
(0.000357s)</font></td>
|
||||
<td>47.4<br>
|
||||
(0.0169s)</td>
|
||||
<td>1.16<br>
|
||||
(0.000416s)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code><p>.*?</p></code></td>
|
||||
<td>1.25<br>
|
||||
(0.000459s)</td>
|
||||
<td><font color="#008000">1<br>
|
||||
(0.000367s)</font></td>
|
||||
<td>NA</td>
|
||||
<td><font color="#008000">1.03<br>
|
||||
(0.000376s)</font></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code> <a[^>]+href=("[^"]*"|[^[:space:]]+)[^>]*></code></td>
|
||||
<td><font color="#008000">1<br>
|
||||
(0.000509s)</font></td>
|
||||
<td><font color="#008000">1.02<br>
|
||||
(0.000518s)</font></td>
|
||||
<td>305<br>
|
||||
(0.155s)</td>
|
||||
<td><font color="#008000">1.1<br>
|
||||
(0.000558s)</font></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code> <h[12345678][^>]*>.*?</h[12345678]></code></td>
|
||||
<td><font color="#008000">1.04<br>
|
||||
(0.00025s)</font></td>
|
||||
<td><font color="#008000">1<br>
|
||||
(0.00024s)</font></td>
|
||||
<td>NA</td>
|
||||
<td>1.16<br>
|
||||
(0.000279s)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code> <img[^>]+src=("[^"]*"|[^[:space:]]+)[^>]*></code></td>
|
||||
<td>2.22<br>
|
||||
(0.000489s)</td>
|
||||
<td>1.69<br>
|
||||
(0.000372s)</td>
|
||||
<td>148<br>
|
||||
(0.0326s)</td>
|
||||
<td><font color="#008000">1<br>
|
||||
(0.00022s)</font></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code> <font[^>]+face=("[^"]*"|[^[:space:]]+)[^>]*>.*?</font></code></td>
|
||||
<td>1.71<br>
|
||||
(0.000371s)</td>
|
||||
<td>1.75<br>
|
||||
(0.000381s)</td>
|
||||
<td>NA</td>
|
||||
<td><font color="#008000">1<br>
|
||||
(0.000218s)</font></td>
|
||||
</tr>
|
||||
</table>
|
||||
<br>
|
||||
<br>
|
||||
<h3>Comparison 3: Simple Matches</h3>
|
||||
<p>For each of the following regular expressions the time taken to match against
|
||||
the text indicated was measured. </p>
|
||||
<table border="1" cellspacing="1">
|
||||
<tr>
|
||||
<td><strong>Expression</strong></td>
|
||||
<td><strong>Text</strong></td>
|
||||
<td><strong>Boost</strong></td>
|
||||
<td><strong>Boost + C++ locale</strong></td>
|
||||
<td><strong>POSIX</strong></td>
|
||||
<td><strong>PCRE</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>abc</code></td>
|
||||
<td>abc</td>
|
||||
<td>1.36<br>
|
||||
(2.15e-07s)</td>
|
||||
<td>1.36<br>
|
||||
(2.15e-07s)</td>
|
||||
<td>2.76<br>
|
||||
(4.34e-07s)</td>
|
||||
<td><font color="#008000">1<br>
|
||||
(1.58e-07s)</font></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>^([0-9]+)(\-| |$)(.*)$</code></td>
|
||||
<td>100- this is a line of ftp response which contains a message string</td>
|
||||
<td>1.55<br>
|
||||
(7.26e-07s)</td>
|
||||
<td>1.51<br>
|
||||
(7.07e-07s)</td>
|
||||
<td>319<br>
|
||||
(0.000149s)</td>
|
||||
<td><font color="#008000">1<br>
|
||||
(4.67e-07s)</font></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>([[:digit:]]{4}[- ]){3}[[:digit:]]{3,4}</code></td>
|
||||
<td>1234-5678-1234-456</td>
|
||||
<td>1.96<br>
|
||||
(9.54e-07s)</td>
|
||||
<td>1.96<br>
|
||||
(9.54e-07s)</td>
|
||||
<td>44.5<br>
|
||||
(2.17e-05s)</td>
|
||||
<td><font color="#008000">1<br>
|
||||
(4.87e-07s)</font></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code> ^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$</code></td>
|
||||
<td>john@johnmaddock.co.uk</td>
|
||||
<td>1.22<br>
|
||||
(1.51e-06s)</td>
|
||||
<td>1.23<br>
|
||||
(1.53e-06s)</td>
|
||||
<td>162<br>
|
||||
(0.000201s)</td>
|
||||
<td><font color="#008000">1<br>
|
||||
(1.24e-06s)</font></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code> ^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$</code></td>
|
||||
<td>foo12@foo.edu</td>
|
||||
<td>1.28<br>
|
||||
(1.47e-06s)</td>
|
||||
<td>1.3<br>
|
||||
(1.49e-06s)</td>
|
||||
<td>104<br>
|
||||
(0.00012s)</td>
|
||||
<td><font color="#008000">1<br>
|
||||
(1.15e-06s)</font></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code> ^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$</code></td>
|
||||
<td>bob.smith@foo.tv</td>
|
||||
<td>1.28<br>
|
||||
(1.47e-06s)</td>
|
||||
<td>1.3<br>
|
||||
(1.49e-06s)</td>
|
||||
<td>113<br>
|
||||
(0.00013s)</td>
|
||||
<td><font color="#008000">1<br>
|
||||
(1.15e-06s)</font></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>^[a-zA-Z]{1,2}[0-9][0-9A-Za-z]{0,1} {0,1}[0-9][A-Za-z]{2}$</code></td>
|
||||
<td>EH10 2QQ</td>
|
||||
<td>1.38<br>
|
||||
(4.68e-07s)</td>
|
||||
<td>1.41<br>
|
||||
(4.77e-07s)</td>
|
||||
<td>13.5<br>
|
||||
(4.59e-06s)</td>
|
||||
<td><font color="#008000">1<br>
|
||||
(3.39e-07s)</font></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>^[a-zA-Z]{1,2}[0-9][0-9A-Za-z]{0,1} {0,1}[0-9][A-Za-z]{2}$</code></td>
|
||||
<td>G1 1AA</td>
|
||||
<td>1.28<br>
|
||||
(4.35e-07s)</td>
|
||||
<td>1.25<br>
|
||||
(4.25e-07s)</td>
|
||||
<td>11.7<br>
|
||||
(3.97e-06s)</td>
|
||||
<td><font color="#008000">1<br>
|
||||
(3.39e-07s)</font></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>^[a-zA-Z]{1,2}[0-9][0-9A-Za-z]{0,1} {0,1}[0-9][A-Za-z]{2}$</code></td>
|
||||
<td>SW1 1ZZ</td>
|
||||
<td>1.32<br>
|
||||
(4.53e-07s)</td>
|
||||
<td>1.31<br>
|
||||
(4.49e-07s)</td>
|
||||
<td>12.2<br>
|
||||
(4.2e-06s)</td>
|
||||
<td><font color="#008000">1<br>
|
||||
(3.44e-07s)</font></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code> ^[[:digit:]]{1,2}/[[:digit:]]{1,2}/[[:digit:]]{4}$</code></td>
|
||||
<td>4/1/2001</td>
|
||||
<td>1.16<br>
|
||||
(3.82e-07s)</td>
|
||||
<td>1.2<br>
|
||||
(3.96e-07s)</td>
|
||||
<td>13.9<br>
|
||||
(4.59e-06s)</td>
|
||||
<td><font color="#008000">1<br>
|
||||
(3.29e-07s)</font></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code> ^[[:digit:]]{1,2}/[[:digit:]]{1,2}/[[:digit:]]{4}$</code></td>
|
||||
<td>12/12/2001</td>
|
||||
<td>1.38<br>
|
||||
(4.49e-07s)</td>
|
||||
<td>1.38<br>
|
||||
(4.49e-07s)</td>
|
||||
<td>16<br>
|
||||
(5.2e-06s)</td>
|
||||
<td><font color="#008000">1<br>
|
||||
(3.25e-07s)</font></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>^[-+]?[[:digit:]]*\.?[[:digit:]]*$</code></td>
|
||||
<td>123</td>
|
||||
<td>1.19<br>
|
||||
(7.64e-07s)</td>
|
||||
<td>1.16<br>
|
||||
(7.45e-07s)</td>
|
||||
<td>7.51<br>
|
||||
(4.81e-06s)</td>
|
||||
<td><font color="#008000">1<br>
|
||||
(6.4e-07s)</font></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>^[-+]?[[:digit:]]*\.?[[:digit:]]*$</code></td>
|
||||
<td>+3.14159</td>
|
||||
<td>1.32<br>
|
||||
(8.97e-07s)</td>
|
||||
<td>1.31<br>
|
||||
(8.88e-07s)</td>
|
||||
<td>14<br>
|
||||
(9.48e-06s)</td>
|
||||
<td><font color="#008000">1<br>
|
||||
(6.78e-07s)</font></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>^[-+]?[[:digit:]]*\.?[[:digit:]]*$</code></td>
|
||||
<td>-3.14159</td>
|
||||
<td>1.32<br>
|
||||
(8.97e-07s)</td>
|
||||
<td>1.31<br>
|
||||
(8.88e-07s)</td>
|
||||
<td>14<br>
|
||||
(9.48e-06s)</td>
|
||||
<td><font color="#008000">1<br>
|
||||
(6.78e-07s)</font></td>
|
||||
</tr>
|
||||
</table>
|
||||
<br>
|
||||
<br>
|
||||
<hr>
|
||||
<p><i>© Copyright John Maddock 2003</i></p>
|
||||
<P><I>Use, modification and distribution are subject to the Boost Software License,
|
||||
Version 1.0. (See accompanying file <A href="../../../LICENSE_1_0.txt">LICENSE_1_0.txt</A>
|
||||
or copy at <A href="http://www.boost.org/LICENSE_1_0.txt">http://www.boost.org/LICENSE_1_0.txt</A>)</I></P>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -15,6 +15,15 @@ Currently open issues can be viewed [@https://svn.boost.org/trac/boost/query?sta
|
||||
|
||||
All issues including closed ones can be viewed [@https://svn.boost.org/trac/boost/query?status=assigned&status=closed&status=new&status=reopened&component=regex&order=priority&col=id&col=summary&col=status&col=type&col=milestone&col=component here].
|
||||
|
||||
[h4 Boost.Regex-5.1.0]
|
||||
|
||||
* Add support for Perl's backtracking control verbs, see [@https://svn.boost.org/trac/boost/ticket/11205 #11205]. Note however, that
|
||||
(*MARK) and operations on marks are not currently supported.
|
||||
* Fix incorrect range end when matching \[\[:unicode:\]\], see [@https://svn.boost.org/trac/boost/ticket/11524 #11524].
|
||||
* Change POSIX reg_comp API to not check potentially uninitialized memory, note that code which was previously free from memory
|
||||
leaks (but none the less buggy, as it didn't call reg_free) will now leak. See [@https://svn.boost.org/trac/boost/ticket/11472 #11472].
|
||||
* Make sub_match a valid C++ range type, see [@https://svn.boost.org/trac/boost/ticket/11036 #11036].
|
||||
|
||||
[h4 Boost.Regex-5.0.1 (Boost-1.58.0)]
|
||||
|
||||
* Fixed some typos as in [@https://svn.boost.org/trac/boost/ticket/10682 #10682].
|
||||
|
||||
@@ -37,6 +37,29 @@
|
||||
and Further Information</a></span></dt>
|
||||
<dt><span class="section"><a href="background_information/faq.html">FAQ</a></span></dt>
|
||||
<dt><span class="section"><a href="background_information/performance.html">Performance</a></span></dt>
|
||||
<dd><dl>
|
||||
<dt><span class="section"><a href="background_information/performance/section_Testing_Perl_searches_platform_Windows_x64_compiler_Microsoft_Visual_C_version_14_0_.html">Testing
|
||||
Perl searches (platform = Windows x64, compiler = Microsoft Visual C++ version
|
||||
14.0)</a></span></dt>
|
||||
<dt><span class="section"><a href="background_information/performance/section_Testing_Perl_searches_platform_linux_compiler_GNU_C_version_5_1_0_.html">Testing
|
||||
Perl searches (platform = linux, compiler = GNU C++ version 5.1.0)</a></span></dt>
|
||||
<dt><span class="section"><a href="background_information/performance/section_Testing_leftmost_longest_searches_platform_Windows_x64_compiler_Microsoft_Visual_C_version_14_0_.html">Testing
|
||||
leftmost-longest searches (platform = Windows x64, compiler = Microsoft Visual
|
||||
C++ version 14.0)</a></span></dt>
|
||||
<dt><span class="section"><a href="background_information/performance/section_Testing_leftmost_longest_searches_platform_linux_compiler_GNU_C_version_5_1_0_.html">Testing
|
||||
leftmost-longest searches (platform = linux, compiler = GNU C++ version 5.1.0)</a></span></dt>
|
||||
<dt><span class="section"><a href="background_information/performance/section_Testing_simple_Perl_matches_platform_Windows_x64_compiler_Microsoft_Visual_C_version_14_0_.html">Testing
|
||||
simple Perl matches (platform = Windows x64, compiler = Microsoft Visual
|
||||
C++ version 14.0)</a></span></dt>
|
||||
<dt><span class="section"><a href="background_information/performance/section_Testing_simple_Perl_matches_platform_linux_compiler_GNU_C_version_5_1_0_.html">Testing
|
||||
simple Perl matches (platform = linux, compiler = GNU C++ version 5.1.0)</a></span></dt>
|
||||
<dt><span class="section"><a href="background_information/performance/section_Testing_simple_leftmost_longest_matches_platform_Windows_x64_compiler_Microsoft_Visual_C_version_14_0_.html">Testing
|
||||
simple leftmost-longest matches (platform = Windows x64, compiler = Microsoft
|
||||
Visual C++ version 14.0)</a></span></dt>
|
||||
<dt><span class="section"><a href="background_information/performance/section_Testing_simple_leftmost_longest_matches_platform_linux_compiler_GNU_C_version_5_1_0_.html">Testing
|
||||
simple leftmost-longest matches (platform = linux, compiler = GNU C++ version
|
||||
5.1.0)</a></span></dt>
|
||||
</dl></dd>
|
||||
<dt><span class="section"><a href="background_information/standards.html">Standards
|
||||
Conformance</a></span></dt>
|
||||
<dt><span class="section"><a href="background_information/redist.html">Redistributables</a></span></dt>
|
||||
|
||||
@@ -37,7 +37,29 @@
|
||||
</p>
|
||||
<h5>
|
||||
<a name="boost_regex.background_information.history.h0"></a>
|
||||
<span class="phrase"><a name="boost_regex.background_information.history.boost_regex_5_0_1__boost_1_58_0_"></a></span><a class="link" href="history.html#boost_regex.background_information.history.boost_regex_5_0_1__boost_1_58_0_">Boost.Regex-5.0.1
|
||||
<span class="phrase"><a name="boost_regex.background_information.history.boost_regex_5_1_0"></a></span><a class="link" href="history.html#boost_regex.background_information.history.boost_regex_5_1_0">Boost.Regex-5.1.0</a>
|
||||
</h5>
|
||||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
|
||||
<li class="listitem">
|
||||
Add support for Perl's backtracking control verbs, see <a href="https://svn.boost.org/trac/boost/ticket/11205" target="_top">#11205</a>.
|
||||
Note however, that (*MARK) and operations on marks are not currently
|
||||
supported.
|
||||
</li>
|
||||
<li class="listitem">
|
||||
Fix incorrect range end when matching [[:unicode:]], see <a href="https://svn.boost.org/trac/boost/ticket/11524" target="_top">#11524</a>.
|
||||
</li>
|
||||
<li class="listitem">
|
||||
Change POSIX reg_comp API to not check potentially uninitialized memory,
|
||||
note that code which was previously free from memory leaks (but none
|
||||
the less buggy, as it didn't call reg_free) will now leak. See <a href="https://svn.boost.org/trac/boost/ticket/11472" target="_top">#11472</a>.
|
||||
</li>
|
||||
<li class="listitem">
|
||||
Make sub_match a valid C++ range type, see <a href="https://svn.boost.org/trac/boost/ticket/11036" target="_top">#11036</a>.
|
||||
</li>
|
||||
</ul></div>
|
||||
<h5>
|
||||
<a name="boost_regex.background_information.history.h1"></a>
|
||||
<span class="phrase"><a name="boost_regex.background_information.history.boost_regex_5_0_1_boost_1_58_0"></a></span><a class="link" href="history.html#boost_regex.background_information.history.boost_regex_5_0_1_boost_1_58_0">Boost.Regex-5.0.1
|
||||
(Boost-1.58.0)</a>
|
||||
</h5>
|
||||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
|
||||
@@ -69,8 +91,8 @@
|
||||
</li>
|
||||
</ul></div>
|
||||
<h5>
|
||||
<a name="boost_regex.background_information.history.h1"></a>
|
||||
<span class="phrase"><a name="boost_regex.background_information.history.boost_regex_5_0_0__boost_1_56_0_"></a></span><a class="link" href="history.html#boost_regex.background_information.history.boost_regex_5_0_0__boost_1_56_0_">Boost.Regex-5.0.0
|
||||
<a name="boost_regex.background_information.history.h2"></a>
|
||||
<span class="phrase"><a name="boost_regex.background_information.history.boost_regex_5_0_0_boost_1_56_0"></a></span><a class="link" href="history.html#boost_regex.background_information.history.boost_regex_5_0_0_boost_1_56_0">Boost.Regex-5.0.0
|
||||
(Boost-1.56.0)</a>
|
||||
</h5>
|
||||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
|
||||
@@ -102,14 +124,14 @@
|
||||
</li>
|
||||
</ul></div>
|
||||
<h5>
|
||||
<a name="boost_regex.background_information.history.h2"></a>
|
||||
<a name="boost_regex.background_information.history.h3"></a>
|
||||
<span class="phrase"><a name="boost_regex.background_information.history.boost_1_54"></a></span><a class="link" href="history.html#boost_regex.background_information.history.boost_1_54">Boost-1.54</a>
|
||||
</h5>
|
||||
<p>
|
||||
Fixed issue <a href="https://svn.boost.org/trac/boost/ticket/8569" target="_top">#8569</a>.
|
||||
</p>
|
||||
<h5>
|
||||
<a name="boost_regex.background_information.history.h3"></a>
|
||||
<a name="boost_regex.background_information.history.h4"></a>
|
||||
<span class="phrase"><a name="boost_regex.background_information.history.boost_1_53"></a></span><a class="link" href="history.html#boost_regex.background_information.history.boost_1_53">Boost-1.53</a>
|
||||
</h5>
|
||||
<p>
|
||||
@@ -117,7 +139,7 @@
|
||||
<a href="https://svn.boost.org/trac/boost/ticket/7644" target="_top">#7644</a>.
|
||||
</p>
|
||||
<h5>
|
||||
<a name="boost_regex.background_information.history.h4"></a>
|
||||
<a name="boost_regex.background_information.history.h5"></a>
|
||||
<span class="phrase"><a name="boost_regex.background_information.history.boost_1_51"></a></span><a class="link" href="history.html#boost_regex.background_information.history.boost_1_51">Boost-1.51</a>
|
||||
</h5>
|
||||
<p>
|
||||
@@ -127,7 +149,7 @@
|
||||
<a href="https://svn.boost.org/trac/boost/ticket/6346" target="_top">#6346</a>.
|
||||
</p>
|
||||
<h5>
|
||||
<a name="boost_regex.background_information.history.h5"></a>
|
||||
<a name="boost_regex.background_information.history.h6"></a>
|
||||
<span class="phrase"><a name="boost_regex.background_information.history.boost_1_50"></a></span><a class="link" href="history.html#boost_regex.background_information.history.boost_1_50">Boost-1.50</a>
|
||||
</h5>
|
||||
<p>
|
||||
@@ -136,7 +158,7 @@
|
||||
expression.
|
||||
</p>
|
||||
<h5>
|
||||
<a name="boost_regex.background_information.history.h6"></a>
|
||||
<a name="boost_regex.background_information.history.h7"></a>
|
||||
<span class="phrase"><a name="boost_regex.background_information.history.boost_1_48"></a></span><a class="link" href="history.html#boost_regex.background_information.history.boost_1_48">Boost-1.48</a>
|
||||
</h5>
|
||||
<p>
|
||||
@@ -146,7 +168,7 @@
|
||||
<a href="https://svn.boost.org/trac/boost/ticket/5736" target="_top">#5736</a>.
|
||||
</p>
|
||||
<h5>
|
||||
<a name="boost_regex.background_information.history.h7"></a>
|
||||
<a name="boost_regex.background_information.history.h8"></a>
|
||||
<span class="phrase"><a name="boost_regex.background_information.history.boost_1_47"></a></span><a class="link" href="history.html#boost_regex.background_information.history.boost_1_47">Boost 1.47</a>
|
||||
</h5>
|
||||
<p>
|
||||
@@ -158,7 +180,7 @@
|
||||
<a href="https://svn.boost.org/trac/boost/ticket/5504" target="_top">#5504</a>.
|
||||
</p>
|
||||
<h5>
|
||||
<a name="boost_regex.background_information.history.h8"></a>
|
||||
<a name="boost_regex.background_information.history.h9"></a>
|
||||
<span class="phrase"><a name="boost_regex.background_information.history.boost_1_44"></a></span><a class="link" href="history.html#boost_regex.background_information.history.boost_1_44">Boost 1.44</a>
|
||||
</h5>
|
||||
<p>
|
||||
@@ -176,7 +198,7 @@
|
||||
<a href="https://svn.boost.org/trac/boost/ticket/3890" target="_top">#3890</a>
|
||||
</p>
|
||||
<h5>
|
||||
<a name="boost_regex.background_information.history.h9"></a>
|
||||
<a name="boost_regex.background_information.history.h10"></a>
|
||||
<span class="phrase"><a name="boost_regex.background_information.history.boost_1_42"></a></span><a class="link" href="history.html#boost_regex.background_information.history.boost_1_42">Boost 1.42</a>
|
||||
</h5>
|
||||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
|
||||
@@ -204,7 +226,7 @@
|
||||
</li>
|
||||
</ul></div>
|
||||
<h5>
|
||||
<a name="boost_regex.background_information.history.h10"></a>
|
||||
<a name="boost_regex.background_information.history.h11"></a>
|
||||
<span class="phrase"><a name="boost_regex.background_information.history.boost_1_40"></a></span><a class="link" href="history.html#boost_regex.background_information.history.boost_1_40">Boost 1.40</a>
|
||||
</h5>
|
||||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
|
||||
@@ -212,7 +234,7 @@
|
||||
branch resets and recursive regular expressions.
|
||||
</li></ul></div>
|
||||
<h5>
|
||||
<a name="boost_regex.background_information.history.h11"></a>
|
||||
<a name="boost_regex.background_information.history.h12"></a>
|
||||
<span class="phrase"><a name="boost_regex.background_information.history.boost_1_38"></a></span><a class="link" href="history.html#boost_regex.background_information.history.boost_1_38">Boost 1.38</a>
|
||||
</h5>
|
||||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
|
||||
@@ -239,7 +261,7 @@
|
||||
</li>
|
||||
</ul></div>
|
||||
<h5>
|
||||
<a name="boost_regex.background_information.history.h12"></a>
|
||||
<a name="boost_regex.background_information.history.h13"></a>
|
||||
<span class="phrase"><a name="boost_regex.background_information.history.boost_1_34"></a></span><a class="link" href="history.html#boost_regex.background_information.history.boost_1_34">Boost 1.34</a>
|
||||
</h5>
|
||||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
|
||||
@@ -261,7 +283,7 @@
|
||||
</li>
|
||||
</ul></div>
|
||||
<h5>
|
||||
<a name="boost_regex.background_information.history.h13"></a>
|
||||
<a name="boost_regex.background_information.history.h14"></a>
|
||||
<span class="phrase"><a name="boost_regex.background_information.history.boost_1_33_1"></a></span><a class="link" href="history.html#boost_regex.background_information.history.boost_1_33_1">Boost 1.33.1</a>
|
||||
</h5>
|
||||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
|
||||
@@ -330,7 +352,7 @@
|
||||
</li>
|
||||
</ul></div>
|
||||
<h5>
|
||||
<a name="boost_regex.background_information.history.h14"></a>
|
||||
<a name="boost_regex.background_information.history.h15"></a>
|
||||
<span class="phrase"><a name="boost_regex.background_information.history.boost_1_33_0"></a></span><a class="link" href="history.html#boost_regex.background_information.history.boost_1_33_0">Boost 1.33.0</a>
|
||||
</h5>
|
||||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
|
||||
@@ -384,14 +406,14 @@
|
||||
</li>
|
||||
</ul></div>
|
||||
<h5>
|
||||
<a name="boost_regex.background_information.history.h15"></a>
|
||||
<a name="boost_regex.background_information.history.h16"></a>
|
||||
<span class="phrase"><a name="boost_regex.background_information.history.boost_1_32_1"></a></span><a class="link" href="history.html#boost_regex.background_information.history.boost_1_32_1">Boost 1.32.1</a>
|
||||
</h5>
|
||||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
|
||||
Fixed bug in partial matches of bounded repeats of '.'.
|
||||
</li></ul></div>
|
||||
<h5>
|
||||
<a name="boost_regex.background_information.history.h16"></a>
|
||||
<a name="boost_regex.background_information.history.h17"></a>
|
||||
<span class="phrase"><a name="boost_regex.background_information.history.boost_1_31_0"></a></span><a class="link" href="history.html#boost_regex.background_information.history.boost_1_31_0">Boost 1.31.0</a>
|
||||
</h5>
|
||||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
</p>
|
||||
<h5>
|
||||
<a name="boost_regex.background_information.locale.h0"></a>
|
||||
<span class="phrase"><a name="boost_regex.background_information.locale.win32_localization_model_"></a></span><a class="link" href="locale.html#boost_regex.background_information.locale.win32_localization_model_">Win32
|
||||
<span class="phrase"><a name="boost_regex.background_information.locale.win32_localization_model"></a></span><a class="link" href="locale.html#boost_regex.background_information.locale.win32_localization_model">Win32
|
||||
localization model.</a>
|
||||
</h5>
|
||||
<p>
|
||||
@@ -91,7 +91,7 @@
|
||||
</p>
|
||||
<h5>
|
||||
<a name="boost_regex.background_information.locale.h1"></a>
|
||||
<span class="phrase"><a name="boost_regex.background_information.locale.c_localization_model_"></a></span><a class="link" href="locale.html#boost_regex.background_information.locale.c_localization_model_">C
|
||||
<span class="phrase"><a name="boost_regex.background_information.locale.c_localization_model"></a></span><a class="link" href="locale.html#boost_regex.background_information.locale.c_localization_model">C
|
||||
localization model.</a>
|
||||
</h5>
|
||||
<p>
|
||||
@@ -115,7 +115,7 @@
|
||||
</p>
|
||||
<h5>
|
||||
<a name="boost_regex.background_information.locale.h2"></a>
|
||||
<span class="phrase"><a name="boost_regex.background_information.locale.c___localization_model_"></a></span><a class="link" href="locale.html#boost_regex.background_information.locale.c___localization_model_">C++
|
||||
<span class="phrase"><a name="boost_regex.background_information.locale.c_localization_model0"></a></span><a class="link" href="locale.html#boost_regex.background_information.locale.c_localization_model0">C++
|
||||
localization model.</a>
|
||||
</h5>
|
||||
<p>
|
||||
@@ -1268,12 +1268,14 @@
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
"Unmatched [ or <code class="literal">" </code>
|
||||
"Unmatched [ or [^"
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
[208
|
||||
208
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<link rel="home" href="../../index.html" title="Boost.Regex 5.0.1">
|
||||
<link rel="up" href="../background_information.html" title="Background Information">
|
||||
<link rel="prev" href="faq.html" title="FAQ">
|
||||
<link rel="next" href="standards.html" title="Standards Conformance">
|
||||
<link rel="next" href="performance/section_Testing_Perl_searches_platform_Windows_x64_compiler_Microsoft_Visual_C_version_14_0_.html" title="Testing Perl searches (platform = Windows x64, compiler = Microsoft Visual C++ version 14.0)">
|
||||
</head>
|
||||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
||||
<table cellpadding="2" width="100%"><tr>
|
||||
@@ -20,12 +20,35 @@
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="faq.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../background_information.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="standards.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
<a accesskey="p" href="faq.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../background_information.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="performance/section_Testing_Perl_searches_platform_Windows_x64_compiler_Microsoft_Visual_C_version_14_0_.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="titlepage"><div><div><h3 class="title">
|
||||
<a name="boost_regex.background_information.performance"></a><a class="link" href="performance.html" title="Performance">Performance</a>
|
||||
</h3></div></div></div>
|
||||
<div class="toc"><dl>
|
||||
<dt><span class="section"><a href="performance/section_Testing_Perl_searches_platform_Windows_x64_compiler_Microsoft_Visual_C_version_14_0_.html">Testing
|
||||
Perl searches (platform = Windows x64, compiler = Microsoft Visual C++ version
|
||||
14.0)</a></span></dt>
|
||||
<dt><span class="section"><a href="performance/section_Testing_Perl_searches_platform_linux_compiler_GNU_C_version_5_1_0_.html">Testing
|
||||
Perl searches (platform = linux, compiler = GNU C++ version 5.1.0)</a></span></dt>
|
||||
<dt><span class="section"><a href="performance/section_Testing_leftmost_longest_searches_platform_Windows_x64_compiler_Microsoft_Visual_C_version_14_0_.html">Testing
|
||||
leftmost-longest searches (platform = Windows x64, compiler = Microsoft Visual
|
||||
C++ version 14.0)</a></span></dt>
|
||||
<dt><span class="section"><a href="performance/section_Testing_leftmost_longest_searches_platform_linux_compiler_GNU_C_version_5_1_0_.html">Testing
|
||||
leftmost-longest searches (platform = linux, compiler = GNU C++ version 5.1.0)</a></span></dt>
|
||||
<dt><span class="section"><a href="performance/section_Testing_simple_Perl_matches_platform_Windows_x64_compiler_Microsoft_Visual_C_version_14_0_.html">Testing
|
||||
simple Perl matches (platform = Windows x64, compiler = Microsoft Visual
|
||||
C++ version 14.0)</a></span></dt>
|
||||
<dt><span class="section"><a href="performance/section_Testing_simple_Perl_matches_platform_linux_compiler_GNU_C_version_5_1_0_.html">Testing
|
||||
simple Perl matches (platform = linux, compiler = GNU C++ version 5.1.0)</a></span></dt>
|
||||
<dt><span class="section"><a href="performance/section_Testing_simple_leftmost_longest_matches_platform_Windows_x64_compiler_Microsoft_Visual_C_version_14_0_.html">Testing
|
||||
simple leftmost-longest matches (platform = Windows x64, compiler = Microsoft
|
||||
Visual C++ version 14.0)</a></span></dt>
|
||||
<dt><span class="section"><a href="performance/section_Testing_simple_leftmost_longest_matches_platform_linux_compiler_GNU_C_version_5_1_0_.html">Testing
|
||||
simple leftmost-longest matches (platform = linux, compiler = GNU C++ version
|
||||
5.1.0)</a></span></dt>
|
||||
</dl></div>
|
||||
<p>
|
||||
The performance of Boost.Regex in both recursive and non-recursive modes
|
||||
should be broadly comparable to other regular expression libraries: recursive
|
||||
@@ -33,16 +56,6 @@
|
||||
synchronisation), but not by much. The following pages compare Boost.Regex
|
||||
with various other regular expression libraries for the following compilers:
|
||||
</p>
|
||||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
|
||||
<li class="listitem">
|
||||
<a href="../../../vc71-performance.html" target="_top">Visual Studio.Net 2003 (recursive
|
||||
Boost.Regex implementation)</a>.
|
||||
</li>
|
||||
<li class="listitem">
|
||||
<a href="../../../gcc-performance.html" target="_top">Gcc 3.2 (cygwin) (non-recursive
|
||||
Boost.Regex implementation)</a>.
|
||||
</li>
|
||||
</ul></div>
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
@@ -54,7 +67,7 @@
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="faq.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../background_information.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="standards.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
<a accesskey="p" href="faq.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../background_information.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="performance/section_Testing_Perl_searches_platform_Windows_x64_compiler_Microsoft_Visual_C_version_14_0_.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+523
@@ -0,0 +1,523 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
||||
<title>Testing Perl searches (platform = Windows x64, compiler = Microsoft Visual C++ version 14.0)</title>
|
||||
<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.77.1">
|
||||
<link rel="home" href="../../../index.html" title="Boost.Regex 5.0.1">
|
||||
<link rel="up" href="../performance.html" title="Performance">
|
||||
<link rel="prev" href="../performance.html" title="Performance">
|
||||
<link rel="next" href="section_Testing_Perl_searches_platform_linux_compiler_GNU_C_version_5_1_0_.html" title="Testing Perl searches (platform = linux, compiler = GNU C++ version 5.1.0)">
|
||||
</head>
|
||||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
||||
<table cellpadding="2" width="100%"><tr>
|
||||
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td>
|
||||
<td align="center"><a href="../../../../../../../index.html">Home</a></td>
|
||||
<td align="center"><a href="../../../../../../../libs/libraries.htm">Libraries</a></td>
|
||||
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
|
||||
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
|
||||
<td align="center"><a href="../../../../../../../more/index.htm">More</a></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="../performance.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../performance.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="section_Testing_Perl_searches_platform_linux_compiler_GNU_C_version_5_1_0_.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="titlepage"><div><div><h4 class="title">
|
||||
<a name="boost_regex.background_information.performance.section_Testing_Perl_searches_platform_Windows_x64_compiler_Microsoft_Visual_C_version_14_0_"></a><a class="link" href="section_Testing_Perl_searches_platform_Windows_x64_compiler_Microsoft_Visual_C_version_14_0_.html" title="Testing Perl searches (platform = Windows x64, compiler = Microsoft Visual C++ version 14.0)">Testing
|
||||
Perl searches (platform = Windows x64, compiler = Microsoft Visual C++ version
|
||||
14.0)</a>
|
||||
</h4></div></div></div>
|
||||
<div class="table">
|
||||
<a name="boost_regex.background_information.performance.section_Testing_Perl_searches_platform_Windows_x64_compiler_Microsoft_Visual_C_version_14_0_.table_Testing_Perl_searches_platform_Windows_x64_compiler_Microsoft_Visual_C_version_14_0_"></a><p class="title"><b>Table 8. Testing Perl searches (platform = Windows x64, compiler = Microsoft
|
||||
Visual C++ version 14.0)</b></p>
|
||||
<div class="table-contents"><table class="table" summary="Testing Perl searches (platform = Windows x64, compiler = Microsoft
|
||||
Visual C++ version 14.0)">
|
||||
<colgroup>
|
||||
<col>
|
||||
<col>
|
||||
<col>
|
||||
<col>
|
||||
<col>
|
||||
<col>
|
||||
</colgroup>
|
||||
<thead><tr>
|
||||
<th>
|
||||
<p>
|
||||
Expression<br> Text
|
||||
</p>
|
||||
</th>
|
||||
<th>
|
||||
<p>
|
||||
boost 1.60
|
||||
</p>
|
||||
</th>
|
||||
<th>
|
||||
<p>
|
||||
PCRE-10.10
|
||||
</p>
|
||||
</th>
|
||||
<th>
|
||||
<p>
|
||||
RE2
|
||||
</p>
|
||||
</th>
|
||||
<th>
|
||||
<p>
|
||||
std::regex
|
||||
</p>
|
||||
</th>
|
||||
<th>
|
||||
<p>
|
||||
boost::xpressive::cregex
|
||||
</p>
|
||||
</th>
|
||||
</tr></thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="literal">(?i)<a[^>]+href=("[^"]*"|[^[:space:]]+)[^>]*></code><br>
|
||||
In file: ..<span class="emphasis"><em>..</em></span>../libs/libraries.htm
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">1.26<br> (320274ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (253424ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">1.45<br> (366324ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="grey">-</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">3.00<br> (759495ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="literal">(?i)<font[^>]+face=("[^"]*"|[^[:space:]]+)[^>]*>.*?</font></code><br>
|
||||
In file: ..<span class="emphasis"><em>..</em></span>../libs/libraries.htm
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">2.94<br> (198426ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">1.28<br> (86670ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (67463ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="grey">-</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">2.92<br> (197323ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="literal">(?i)<h[12345678][^>]*>.*?</h[12345678]></code><br>
|
||||
In file: ..<span class="emphasis"><em>..</em></span>../libs/libraries.htm
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">2.42<br> (196304ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">1.26<br> (102129ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (81160ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="grey">-</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="red">5.12<br> (415932ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="literal">(?i)<img[^>]+src=("[^"]*"|[^[:space:]]+)[^>]*></code><br>
|
||||
In file: ..<span class="emphasis"><em>..</em></span>../libs/libraries.htm
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">2.87<br> (196348ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">1.28<br> (87365ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (68502ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="grey">-</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">3.25<br> (222612ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="literal">(?i)<p>.*?</p></code><br> In file:
|
||||
..<span class="emphasis"><em>..</em></span>../libs/libraries.htm
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">2.78<br> (194346ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">1.27<br> (88709ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (70020ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="grey">-</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="red">4.03<br> (282425ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="literal">(\w+)\s*(\([^()]++(?:(?2)[^()]++)*+[^)]*\))\s*(\{[^{}]++((?3)[^{}]++)*+[^}]*+\})</code><br>
|
||||
In file: boost/multiprecision/number.hpp
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (1094575ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">2.87<br> (3136734ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="grey">-</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="grey">-</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="grey">-</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="literal">(^[ \t]*#(?:(?>[^\\\n]+)|\\(?>\s*\n|.))*)|</code><br>
|
||||
In file: boost/multiprecision/number.hpp
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">1.92<br> (11651545ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (6057879ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="grey">-</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="grey">-</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">1.55<br> (9388319ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="literal">(template[[:space:]]*<[^;:{]+>[[:space:]]*)?(class|struct)[[:space:]]*(\w+([
|
||||
]*\([^)]*\))?[\u0 ...</code><br> In file: boost/multiprecision/number.hpp
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="red">29.23<br> (8736875ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="red">38.71<br> (11569512ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (298862ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="red">995.92<br> (297642713ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="red">27.63<br> (8258368ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="literal">Beman|John|Dave</code><br> In file: ..<span class="emphasis"><em>..</em></span>../libs/libraries.htm
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">1.60<br> (153603ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.10<br> (105220ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">2.55<br> (244839ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="red">8.53<br> (819095ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (96081ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="literal">\w+\s*(\([^()]++(?:(?1)[^()]++)*+[^)]*\))</code><br>
|
||||
In file: boost/multiprecision/number.hpp
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (1099128ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">1.66<br> (1824126ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="grey">-</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="grey">-</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="grey">-</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="literal">\{[^{}]++((?0)[^{}]++)*+[^}]*+\}</code><br> In
|
||||
file: boost/multiprecision/number.hpp
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">1.60<br> (243611ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (152166ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="grey">-</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="grey">-</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="grey">-</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="literal">^[ ]*#[ ]*include[ ]+("[^"]+"|<[^>]+>)</code><br>
|
||||
In file: boost/multiprecision/number.hpp
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">1.54<br> (260929ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.18<br> (198707ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">1.81<br> (305923ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="red">8.53<br> (1440180ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (168902ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="literal">^[ ]*#[ ]*include[ ]+("boost/[^"]+"|<boost/[^>]+>)</code><br>
|
||||
In file: boost/multiprecision/number.hpp
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">1.52<br> (256685ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.17<br> (198358ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">1.80<br> (303602ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="red">8.51<br> (1438197ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (168968ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table></div>
|
||||
</div>
|
||||
<br class="table-break">
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 1998-2013 John Maddock<p>
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
|
||||
</p>
|
||||
</div></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="../performance.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../performance.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="section_Testing_Perl_searches_platform_linux_compiler_GNU_C_version_5_1_0_.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
+451
@@ -0,0 +1,451 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
||||
<title>Testing Perl searches (platform = linux, compiler = GNU C++ version 5.1.0)</title>
|
||||
<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.77.1">
|
||||
<link rel="home" href="../../../index.html" title="Boost.Regex 5.0.1">
|
||||
<link rel="up" href="../performance.html" title="Performance">
|
||||
<link rel="prev" href="section_Testing_Perl_searches_platform_Windows_x64_compiler_Microsoft_Visual_C_version_14_0_.html" title="Testing Perl searches (platform = Windows x64, compiler = Microsoft Visual C++ version 14.0)">
|
||||
<link rel="next" href="section_Testing_leftmost_longest_searches_platform_Windows_x64_compiler_Microsoft_Visual_C_version_14_0_.html" title="Testing leftmost-longest searches (platform = Windows x64, compiler = Microsoft Visual C++ version 14.0)">
|
||||
</head>
|
||||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
||||
<table cellpadding="2" width="100%"><tr>
|
||||
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td>
|
||||
<td align="center"><a href="../../../../../../../index.html">Home</a></td>
|
||||
<td align="center"><a href="../../../../../../../libs/libraries.htm">Libraries</a></td>
|
||||
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
|
||||
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
|
||||
<td align="center"><a href="../../../../../../../more/index.htm">More</a></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="section_Testing_Perl_searches_platform_Windows_x64_compiler_Microsoft_Visual_C_version_14_0_.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../performance.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="section_Testing_leftmost_longest_searches_platform_Windows_x64_compiler_Microsoft_Visual_C_version_14_0_.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="titlepage"><div><div><h4 class="title">
|
||||
<a name="boost_regex.background_information.performance.section_Testing_Perl_searches_platform_linux_compiler_GNU_C_version_5_1_0_"></a><a class="link" href="section_Testing_Perl_searches_platform_linux_compiler_GNU_C_version_5_1_0_.html" title="Testing Perl searches (platform = linux, compiler = GNU C++ version 5.1.0)">Testing
|
||||
Perl searches (platform = linux, compiler = GNU C++ version 5.1.0)</a>
|
||||
</h4></div></div></div>
|
||||
<div class="table">
|
||||
<a name="boost_regex.background_information.performance.section_Testing_Perl_searches_platform_linux_compiler_GNU_C_version_5_1_0_.table_Testing_Perl_searches_platform_linux_compiler_GNU_C_version_5_1_0_"></a><p class="title"><b>Table 9. Testing Perl searches (platform = linux, compiler = GNU C++ version
|
||||
5.1.0)</b></p>
|
||||
<div class="table-contents"><table class="table" summary="Testing Perl searches (platform = linux, compiler = GNU C++ version
|
||||
5.1.0)">
|
||||
<colgroup>
|
||||
<col>
|
||||
<col>
|
||||
<col>
|
||||
<col>
|
||||
<col>
|
||||
</colgroup>
|
||||
<thead><tr>
|
||||
<th>
|
||||
<p>
|
||||
Expression<br> Text
|
||||
</p>
|
||||
</th>
|
||||
<th>
|
||||
<p>
|
||||
std::regex
|
||||
</p>
|
||||
</th>
|
||||
<th>
|
||||
<p>
|
||||
boost 1.59
|
||||
</p>
|
||||
</th>
|
||||
<th>
|
||||
<p>
|
||||
boost::xpressive::cregex
|
||||
</p>
|
||||
</th>
|
||||
<th>
|
||||
<p>
|
||||
PCRE-10.10
|
||||
</p>
|
||||
</th>
|
||||
</tr></thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="literal">(?i)<a[^>]+href=("[^"]*"|[^[:space:]]+)[^>]*></code><br>
|
||||
In file: ..<span class="emphasis"><em>..</em></span>../libs/libraries.htm
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="grey">-</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">1.44<br> (340578ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">1.49<br> (354327ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (237126ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="literal">(?i)<font[^>]+face=("[^"]*"|[^[:space:]]+)[^>]*>.*?</font></code><br>
|
||||
In file: ..<span class="emphasis"><em>..</em></span>../libs/libraries.htm
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="grey">-</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">2.19<br> (160902ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">1.21<br> (89265ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (73565ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="literal">(?i)<h[12345678][^>]*>.*?</h[12345678]></code><br>
|
||||
In file: ..<span class="emphasis"><em>..</em></span>../libs/libraries.htm
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="grey">-</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">1.90<br> (161009ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">2.30<br> (194911ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (84846ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="literal">(?i)<img[^>]+src=("[^"]*"|[^[:space:]]+)[^>]*></code><br>
|
||||
In file: ..<span class="emphasis"><em>..</em></span>../libs/libraries.htm
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="grey">-</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">2.27<br> (164055ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">1.38<br> (100267ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (72402ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="literal">(?i)<p>.*?</p></code><br> In file:
|
||||
..<span class="emphasis"><em>..</em></span>../libs/libraries.htm
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="grey">-</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">2.14<br> (160542ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">1.72<br> (129220ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (75127ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="literal">(\w+)\s*(\([^()]++(?:(?2)[^()]++)*+[^)]*\))\s*(\{[^{}]++((?3)[^{}]++)*+[^}]*+\})</code><br>
|
||||
In file: boost/multiprecision/number.hpp
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="grey">-</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (1136822ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="grey">-</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">2.55<br> (2896286ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="literal">(^[ \t]*#(?:(?>[^\\\n]+)|\\(?>\s*\n|.))*)|</code><br>
|
||||
In file: boost/multiprecision/number.hpp
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="grey">-</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">1.88<br> (11915857ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.14<br> (7206389ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (6347410ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="literal">(template[[:space:]]*<[^;:{]+>[[:space:]]*)?(class|struct)[[:space:]]*(\w+([
|
||||
]*\([^)]*\))?[\u0 ...</code><br> In file: boost/multiprecision/number.hpp
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">3.55<br> (20770292ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">1.78<br> (10395642ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (5856680ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">1.84<br> (10752084ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="literal">Beman|John|Dave</code><br> In file: ..<span class="emphasis"><em>..</em></span>../libs/libraries.htm
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="red">33.79<br> (2157684ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (63861ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.13<br> (72354ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.15<br> (73190ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="literal">\w+\s*(\([^()]++(?:(?1)[^()]++)*+[^)]*\))</code><br>
|
||||
In file: boost/multiprecision/number.hpp
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="grey">-</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (1167674ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="grey">-</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">1.47<br> (1710795ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="literal">\{[^{}]++((?0)[^{}]++)*+[^}]*+\}</code><br> In
|
||||
file: boost/multiprecision/number.hpp
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="grey">-</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">1.32<br> (150540ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="grey">-</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (114132ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="literal">^[ ]*#[ ]*include[ ]+("[^"]+"|<[^>]+>)</code><br>
|
||||
In file: boost/multiprecision/number.hpp
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="red">10.62<br> (1269946ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">1.43<br> (171067ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (119573ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">1.35<br> (161102ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="literal">^[ ]*#[ ]*include[ ]+("boost/[^"]+"|<boost/[^>]+>)</code><br>
|
||||
In file: boost/multiprecision/number.hpp
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="red">10.59<br> (1271338ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">1.44<br> (173240ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (120003ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">1.34<br> (160962ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table></div>
|
||||
</div>
|
||||
<br class="table-break">
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 1998-2013 John Maddock<p>
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
|
||||
</p>
|
||||
</div></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="section_Testing_Perl_searches_platform_Windows_x64_compiler_Microsoft_Visual_C_version_14_0_.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../performance.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="section_Testing_leftmost_longest_searches_platform_Windows_x64_compiler_Microsoft_Visual_C_version_14_0_.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
+130
@@ -0,0 +1,130 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
||||
<title>Testing leftmost-longest searches (platform = Windows x64, compiler = Microsoft Visual C++ version 14.0)</title>
|
||||
<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.77.1">
|
||||
<link rel="home" href="../../../index.html" title="Boost.Regex 5.0.1">
|
||||
<link rel="up" href="../performance.html" title="Performance">
|
||||
<link rel="prev" href="section_Testing_Perl_searches_platform_linux_compiler_GNU_C_version_5_1_0_.html" title="Testing Perl searches (platform = linux, compiler = GNU C++ version 5.1.0)">
|
||||
<link rel="next" href="section_Testing_leftmost_longest_searches_platform_linux_compiler_GNU_C_version_5_1_0_.html" title="Testing leftmost-longest searches (platform = linux, compiler = GNU C++ version 5.1.0)">
|
||||
</head>
|
||||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
||||
<table cellpadding="2" width="100%"><tr>
|
||||
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td>
|
||||
<td align="center"><a href="../../../../../../../index.html">Home</a></td>
|
||||
<td align="center"><a href="../../../../../../../libs/libraries.htm">Libraries</a></td>
|
||||
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
|
||||
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
|
||||
<td align="center"><a href="../../../../../../../more/index.htm">More</a></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="section_Testing_Perl_searches_platform_linux_compiler_GNU_C_version_5_1_0_.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../performance.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="section_Testing_leftmost_longest_searches_platform_linux_compiler_GNU_C_version_5_1_0_.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="titlepage"><div><div><h4 class="title">
|
||||
<a name="boost_regex.background_information.performance.section_Testing_leftmost_longest_searches_platform_Windows_x64_compiler_Microsoft_Visual_C_version_14_0_"></a><a class="link" href="section_Testing_leftmost_longest_searches_platform_Windows_x64_compiler_Microsoft_Visual_C_version_14_0_.html" title="Testing leftmost-longest searches (platform = Windows x64, compiler = Microsoft Visual C++ version 14.0)">Testing
|
||||
leftmost-longest searches (platform = Windows x64, compiler = Microsoft Visual
|
||||
C++ version 14.0)</a>
|
||||
</h4></div></div></div>
|
||||
<div class="table">
|
||||
<a name="boost_regex.background_information.performance.section_Testing_leftmost_longest_searches_platform_Windows_x64_compiler_Microsoft_Visual_C_version_14_0_.table_Testing_leftmost_longest_searches_platform_Windows_x64_compiler_Microsoft_Visual_C_version_14_0_"></a><p class="title"><b>Table 10. Testing leftmost-longest searches (platform = Windows x64, compiler
|
||||
= Microsoft Visual C++ version 14.0)</b></p>
|
||||
<div class="table-contents"><table class="table" summary="Testing leftmost-longest searches (platform = Windows x64, compiler
|
||||
= Microsoft Visual C++ version 14.0)">
|
||||
<colgroup>
|
||||
<col>
|
||||
<col>
|
||||
<col>
|
||||
</colgroup>
|
||||
<thead><tr>
|
||||
<th>
|
||||
<p>
|
||||
Expression<br> Text
|
||||
</p>
|
||||
</th>
|
||||
<th>
|
||||
<p>
|
||||
boost 1.60
|
||||
</p>
|
||||
</th>
|
||||
<th>
|
||||
<p>
|
||||
std::regex
|
||||
</p>
|
||||
</th>
|
||||
</tr></thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="literal"><a[^>]+href=("[^"]*"|[^[:space:]]+)[^>]*></code><br>
|
||||
In file: ..<span class="emphasis"><em>..</em></span>../libs/libraries.htm
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (1518659ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="red">7.17<br> (10890189ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="literal"><img[^>]+src=("[^"]*"|[^[:space:]]+)[^>]*></code><br>
|
||||
In file: ..<span class="emphasis"><em>..</em></span>../libs/libraries.htm
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (185869ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">3.77<br> (700484ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="literal">Beman|John|Dave</code><br> In file: ..<span class="emphasis"><em>..</em></span>../libs/libraries.htm
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (165840ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="red">4.95<br> (820933ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table></div>
|
||||
</div>
|
||||
<br class="table-break">
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 1998-2013 John Maddock<p>
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
|
||||
</p>
|
||||
</div></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="section_Testing_Perl_searches_platform_linux_compiler_GNU_C_version_5_1_0_.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../performance.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="section_Testing_leftmost_longest_searches_platform_linux_compiler_GNU_C_version_5_1_0_.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
+150
@@ -0,0 +1,150 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
||||
<title>Testing leftmost-longest searches (platform = linux, compiler = GNU C++ version 5.1.0)</title>
|
||||
<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.77.1">
|
||||
<link rel="home" href="../../../index.html" title="Boost.Regex 5.0.1">
|
||||
<link rel="up" href="../performance.html" title="Performance">
|
||||
<link rel="prev" href="section_Testing_leftmost_longest_searches_platform_Windows_x64_compiler_Microsoft_Visual_C_version_14_0_.html" title="Testing leftmost-longest searches (platform = Windows x64, compiler = Microsoft Visual C++ version 14.0)">
|
||||
<link rel="next" href="section_Testing_simple_Perl_matches_platform_Windows_x64_compiler_Microsoft_Visual_C_version_14_0_.html" title="Testing simple Perl matches (platform = Windows x64, compiler = Microsoft Visual C++ version 14.0)">
|
||||
</head>
|
||||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
||||
<table cellpadding="2" width="100%"><tr>
|
||||
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td>
|
||||
<td align="center"><a href="../../../../../../../index.html">Home</a></td>
|
||||
<td align="center"><a href="../../../../../../../libs/libraries.htm">Libraries</a></td>
|
||||
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
|
||||
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
|
||||
<td align="center"><a href="../../../../../../../more/index.htm">More</a></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="section_Testing_leftmost_longest_searches_platform_Windows_x64_compiler_Microsoft_Visual_C_version_14_0_.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../performance.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="section_Testing_simple_Perl_matches_platform_Windows_x64_compiler_Microsoft_Visual_C_version_14_0_.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="titlepage"><div><div><h4 class="title">
|
||||
<a name="boost_regex.background_information.performance.section_Testing_leftmost_longest_searches_platform_linux_compiler_GNU_C_version_5_1_0_"></a><a class="link" href="section_Testing_leftmost_longest_searches_platform_linux_compiler_GNU_C_version_5_1_0_.html" title="Testing leftmost-longest searches (platform = linux, compiler = GNU C++ version 5.1.0)">Testing
|
||||
leftmost-longest searches (platform = linux, compiler = GNU C++ version 5.1.0)</a>
|
||||
</h4></div></div></div>
|
||||
<div class="table">
|
||||
<a name="boost_regex.background_information.performance.section_Testing_leftmost_longest_searches_platform_linux_compiler_GNU_C_version_5_1_0_.table_Testing_leftmost_longest_searches_platform_linux_compiler_GNU_C_version_5_1_0_"></a><p class="title"><b>Table 11. Testing leftmost-longest searches (platform = linux, compiler =
|
||||
GNU C++ version 5.1.0)</b></p>
|
||||
<div class="table-contents"><table class="table" summary="Testing leftmost-longest searches (platform = linux, compiler =
|
||||
GNU C++ version 5.1.0)">
|
||||
<colgroup>
|
||||
<col>
|
||||
<col>
|
||||
<col>
|
||||
<col>
|
||||
</colgroup>
|
||||
<thead><tr>
|
||||
<th>
|
||||
<p>
|
||||
Expression<br> Text
|
||||
</p>
|
||||
</th>
|
||||
<th>
|
||||
<p>
|
||||
std::regex
|
||||
</p>
|
||||
</th>
|
||||
<th>
|
||||
<p>
|
||||
boost 1.59
|
||||
</p>
|
||||
</th>
|
||||
<th>
|
||||
<p>
|
||||
POSIX
|
||||
</p>
|
||||
</th>
|
||||
</tr></thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="literal"><a[^>]+href=("[^"]*"|[^[:space:]]+)[^>]*></code><br>
|
||||
In file: ..<span class="emphasis"><em>..</em></span>../libs/libraries.htm
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">1.47<br> (2329256ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (1583069ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">2.43<br> (3849462ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="literal"><img[^>]+src=("[^"]*"|[^[:space:]]+)[^>]*></code><br>
|
||||
In file: ..<span class="emphasis"><em>..</em></span>../libs/libraries.htm
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="red">10.94<br> (1129103ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (103241ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.01<br> (104450ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="literal">Beman|John|Dave</code><br> In file: ..<span class="emphasis"><em>..</em></span>../libs/libraries.htm
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="red">30.21<br> (2093732ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (69316ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">1.32<br> (91168ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table></div>
|
||||
</div>
|
||||
<br class="table-break">
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 1998-2013 John Maddock<p>
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
|
||||
</p>
|
||||
</div></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="section_Testing_leftmost_longest_searches_platform_Windows_x64_compiler_Microsoft_Visual_C_version_14_0_.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../performance.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="section_Testing_simple_Perl_matches_platform_Windows_x64_compiler_Microsoft_Visual_C_version_14_0_.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
+556
@@ -0,0 +1,556 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
||||
<title>Testing simple Perl matches (platform = Windows x64, compiler = Microsoft Visual C++ version 14.0)</title>
|
||||
<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.77.1">
|
||||
<link rel="home" href="../../../index.html" title="Boost.Regex 5.0.1">
|
||||
<link rel="up" href="../performance.html" title="Performance">
|
||||
<link rel="prev" href="section_Testing_leftmost_longest_searches_platform_linux_compiler_GNU_C_version_5_1_0_.html" title="Testing leftmost-longest searches (platform = linux, compiler = GNU C++ version 5.1.0)">
|
||||
<link rel="next" href="section_Testing_simple_Perl_matches_platform_linux_compiler_GNU_C_version_5_1_0_.html" title="Testing simple Perl matches (platform = linux, compiler = GNU C++ version 5.1.0)">
|
||||
</head>
|
||||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
||||
<table cellpadding="2" width="100%"><tr>
|
||||
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td>
|
||||
<td align="center"><a href="../../../../../../../index.html">Home</a></td>
|
||||
<td align="center"><a href="../../../../../../../libs/libraries.htm">Libraries</a></td>
|
||||
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
|
||||
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
|
||||
<td align="center"><a href="../../../../../../../more/index.htm">More</a></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="section_Testing_leftmost_longest_searches_platform_linux_compiler_GNU_C_version_5_1_0_.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../performance.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="section_Testing_simple_Perl_matches_platform_linux_compiler_GNU_C_version_5_1_0_.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="titlepage"><div><div><h4 class="title">
|
||||
<a name="boost_regex.background_information.performance.section_Testing_simple_Perl_matches_platform_Windows_x64_compiler_Microsoft_Visual_C_version_14_0_"></a><a class="link" href="section_Testing_simple_Perl_matches_platform_Windows_x64_compiler_Microsoft_Visual_C_version_14_0_.html" title="Testing simple Perl matches (platform = Windows x64, compiler = Microsoft Visual C++ version 14.0)">Testing
|
||||
simple Perl matches (platform = Windows x64, compiler = Microsoft Visual
|
||||
C++ version 14.0)</a>
|
||||
</h4></div></div></div>
|
||||
<div class="table">
|
||||
<a name="boost_regex.background_information.performance.section_Testing_simple_Perl_matches_platform_Windows_x64_compiler_Microsoft_Visual_C_version_14_0_.table_Testing_simple_Perl_matches_platform_Windows_x64_compiler_Microsoft_Visual_C_version_14_0_"></a><p class="title"><b>Table 12. Testing simple Perl matches (platform = Windows x64, compiler =
|
||||
Microsoft Visual C++ version 14.0)</b></p>
|
||||
<div class="table-contents"><table class="table" summary="Testing simple Perl matches (platform = Windows x64, compiler =
|
||||
Microsoft Visual C++ version 14.0)">
|
||||
<colgroup>
|
||||
<col>
|
||||
<col>
|
||||
<col>
|
||||
<col>
|
||||
<col>
|
||||
<col>
|
||||
</colgroup>
|
||||
<thead><tr>
|
||||
<th>
|
||||
<p>
|
||||
Expression<br> Text
|
||||
</p>
|
||||
</th>
|
||||
<th>
|
||||
<p>
|
||||
boost 1.60
|
||||
</p>
|
||||
</th>
|
||||
<th>
|
||||
<p>
|
||||
PCRE-10.10
|
||||
</p>
|
||||
</th>
|
||||
<th>
|
||||
<p>
|
||||
RE2
|
||||
</p>
|
||||
</th>
|
||||
<th>
|
||||
<p>
|
||||
std::regex
|
||||
</p>
|
||||
</th>
|
||||
<th>
|
||||
<p>
|
||||
boost::xpressive::cregex
|
||||
</p>
|
||||
</th>
|
||||
</tr></thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="literal">([[:digit:]]{4}[- ]){3}[[:digit:]]{3,4}</code><br>
|
||||
<code class="literal">1234-5678-1234-456</code>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">2.03<br> (323ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">1.25<br> (198ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (159ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="red">20.73<br> (3296ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">1.38<br> (220ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="literal">^([0-9]+)(\-| |$)(.*)$</code><br> <code class="literal">100-
|
||||
this is a line of ftp response which contains a message string</code>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">1.71<br> (257ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">2.01<br> (302ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">2.38<br> (357ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="red">30.81<br> (4622ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (150ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="literal">^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\
|
||||
...</code><br> <code class="literal">bob.smith@foo.tv</code>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">2.66<br> (404ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">2.09<br> (317ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (152ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="red">38.14<br> (5798ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">1.87<br> (284ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="literal">^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\
|
||||
...</code><br> <code class="literal">foo12@foo.edu</code>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">2.90<br> (406ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">2.31<br> (323ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (140ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="red">41.41<br> (5797ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">2.00<br> (280ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="literal">^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\
|
||||
...</code><br> <code class="literal">john@johnmaddock.co.uk</code>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">2.74<br> (477ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">2.17<br> (378ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (174ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="red">38.15<br> (6638ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">2.20<br> (382ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="literal">^[-+]?[[:digit:]]*\.?[[:digit:]]*$</code><br>
|
||||
<code class="literal">+3.14159</code>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">1.63<br> (171ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.14<br> (120ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.13<br> (119ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="red">34.15<br> (3586ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (105ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="literal">^[-+]?[[:digit:]]*\.?[[:digit:]]*$</code><br>
|
||||
<code class="literal">-3.14159</code>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">1.69<br> (171ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.18<br> (119ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.18<br> (119ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="red">35.54<br> (3590ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (101ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="literal">^[-+]?[[:digit:]]*\.?[[:digit:]]*$</code><br>
|
||||
<code class="literal">123</code>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">1.60<br> (149ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.15<br> (107ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.10<br> (102ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="red">39.99<br> (3719ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (93ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="literal">^[[:digit:]]{1,2}/[[:digit:]]{1,2}/[[:digit:]]{4}$</code><br>
|
||||
<code class="literal">12/12/2001</code>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">1.65<br> (162ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (98ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">1.31<br> (128ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="red">16.57<br> (1624ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.03<br> (101ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="literal">^[[:digit:]]{1,2}/[[:digit:]]{1,2}/[[:digit:]]{4}$</code><br>
|
||||
<code class="literal">4/1/2001</code>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">1.58<br> (153ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (97ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.19<br> (115ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="red">16.54<br> (1604ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.02<br> (99ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="literal">^[a-zA-Z]{1,2}[0-9][0-9A-Za-z]{0,1} {0,1}[0-9][A-Za-z]{2}$</code><br>
|
||||
<code class="literal">EH10 2QQ</code>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">1.57<br> (170ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (108ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.10<br> (119ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="red">21.83<br> (2358ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (108ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="literal">^[a-zA-Z]{1,2}[0-9][0-9A-Za-z]{0,1} {0,1}[0-9][A-Za-z]{2}$</code><br>
|
||||
<code class="literal">G1 1AA</code>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">1.50<br> (159ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.01<br> (107ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.05<br> (111ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="red">17.67<br> (1873ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (106ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="literal">^[a-zA-Z]{1,2}[0-9][0-9A-Za-z]{0,1} {0,1}[0-9][A-Za-z]{2}$</code><br>
|
||||
<code class="literal">SW1 1ZZ</code>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">1.53<br> (164ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (107ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.07<br> (115ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="red">18.05<br> (1931ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (107ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="literal">abc</code><br> <code class="literal">abc</code>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">2.10<br> (128ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (61ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">1.30<br> (79ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="red">9.89<br> (603ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">1.25<br> (76ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table></div>
|
||||
</div>
|
||||
<br class="table-break">
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 1998-2013 John Maddock<p>
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
|
||||
</p>
|
||||
</div></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="section_Testing_leftmost_longest_searches_platform_linux_compiler_GNU_C_version_5_1_0_.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../performance.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="section_Testing_simple_Perl_matches_platform_linux_compiler_GNU_C_version_5_1_0_.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
+479
@@ -0,0 +1,479 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
||||
<title>Testing simple Perl matches (platform = linux, compiler = GNU C++ version 5.1.0)</title>
|
||||
<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.77.1">
|
||||
<link rel="home" href="../../../index.html" title="Boost.Regex 5.0.1">
|
||||
<link rel="up" href="../performance.html" title="Performance">
|
||||
<link rel="prev" href="section_Testing_simple_Perl_matches_platform_Windows_x64_compiler_Microsoft_Visual_C_version_14_0_.html" title="Testing simple Perl matches (platform = Windows x64, compiler = Microsoft Visual C++ version 14.0)">
|
||||
<link rel="next" href="section_Testing_simple_leftmost_longest_matches_platform_Windows_x64_compiler_Microsoft_Visual_C_version_14_0_.html" title="Testing simple leftmost-longest matches (platform = Windows x64, compiler = Microsoft Visual C++ version 14.0)">
|
||||
</head>
|
||||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
||||
<table cellpadding="2" width="100%"><tr>
|
||||
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td>
|
||||
<td align="center"><a href="../../../../../../../index.html">Home</a></td>
|
||||
<td align="center"><a href="../../../../../../../libs/libraries.htm">Libraries</a></td>
|
||||
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
|
||||
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
|
||||
<td align="center"><a href="../../../../../../../more/index.htm">More</a></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="section_Testing_simple_Perl_matches_platform_Windows_x64_compiler_Microsoft_Visual_C_version_14_0_.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../performance.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="section_Testing_simple_leftmost_longest_matches_platform_Windows_x64_compiler_Microsoft_Visual_C_version_14_0_.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="titlepage"><div><div><h4 class="title">
|
||||
<a name="boost_regex.background_information.performance.section_Testing_simple_Perl_matches_platform_linux_compiler_GNU_C_version_5_1_0_"></a><a class="link" href="section_Testing_simple_Perl_matches_platform_linux_compiler_GNU_C_version_5_1_0_.html" title="Testing simple Perl matches (platform = linux, compiler = GNU C++ version 5.1.0)">Testing
|
||||
simple Perl matches (platform = linux, compiler = GNU C++ version 5.1.0)</a>
|
||||
</h4></div></div></div>
|
||||
<div class="table">
|
||||
<a name="boost_regex.background_information.performance.section_Testing_simple_Perl_matches_platform_linux_compiler_GNU_C_version_5_1_0_.table_Testing_simple_Perl_matches_platform_linux_compiler_GNU_C_version_5_1_0_"></a><p class="title"><b>Table 13. Testing simple Perl matches (platform = linux, compiler = GNU C++
|
||||
version 5.1.0)</b></p>
|
||||
<div class="table-contents"><table class="table" summary="Testing simple Perl matches (platform = linux, compiler = GNU C++
|
||||
version 5.1.0)">
|
||||
<colgroup>
|
||||
<col>
|
||||
<col>
|
||||
<col>
|
||||
<col>
|
||||
<col>
|
||||
</colgroup>
|
||||
<thead><tr>
|
||||
<th>
|
||||
<p>
|
||||
Expression<br> Text
|
||||
</p>
|
||||
</th>
|
||||
<th>
|
||||
<p>
|
||||
std::regex
|
||||
</p>
|
||||
</th>
|
||||
<th>
|
||||
<p>
|
||||
boost 1.59
|
||||
</p>
|
||||
</th>
|
||||
<th>
|
||||
<p>
|
||||
boost::xpressive::cregex
|
||||
</p>
|
||||
</th>
|
||||
<th>
|
||||
<p>
|
||||
PCRE-10.10
|
||||
</p>
|
||||
</th>
|
||||
</tr></thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="literal">([[:digit:]]{4}[- ]){3}[[:digit:]]{3,4}</code><br>
|
||||
<code class="literal">1234-5678-1234-456</code>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">2.72<br> (384ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">2.85<br> (402ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (141ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">1.33<br> (187ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="literal">^([0-9]+)(\-| |$)(.*)$</code><br> <code class="literal">100-
|
||||
this is a line of ftp response which contains a message string</code>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="red">19.85<br> (2124ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">2.68<br> (287ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (107ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">2.94<br> (315ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="literal">^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\
|
||||
...</code><br> <code class="literal">bob.smith@foo.tv</code>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="grey">-</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">2.16<br> (542ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (251ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">1.25<br> (315ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="literal">^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\
|
||||
...</code><br> <code class="literal">foo12@foo.edu</code>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="grey">-</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">2.22<br> (554ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (250ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">1.28<br> (319ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="literal">^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\
|
||||
...</code><br> <code class="literal">john@johnmaddock.co.uk</code>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="grey">-</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">2.10<br> (657ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (313ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.16<br> (364ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="literal">^[-+]?[[:digit:]]*\.?[[:digit:]]*$</code><br>
|
||||
<code class="literal">+3.14159</code>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="red">4.08<br> (339ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">2.51<br> (208ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (83ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">1.42<br> (118ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="literal">^[-+]?[[:digit:]]*\.?[[:digit:]]*$</code><br>
|
||||
<code class="literal">-3.14159</code>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="red">4.14<br> (335ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">2.49<br> (202ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (81ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">1.46<br> (118ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="literal">^[-+]?[[:digit:]]*\.?[[:digit:]]*$</code><br>
|
||||
<code class="literal">123</code>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">3.17<br> (254ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">2.25<br> (180ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (80ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">1.32<br> (106ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="literal">^[[:digit:]]{1,2}/[[:digit:]]{1,2}/[[:digit:]]{4}$</code><br>
|
||||
<code class="literal">12/12/2001</code>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">3.02<br> (248ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">2.52<br> (207ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (82ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.18<br> (97ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="literal">^[[:digit:]]{1,2}/[[:digit:]]{1,2}/[[:digit:]]{4}$</code><br>
|
||||
<code class="literal">4/1/2001</code>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">2.70<br> (216ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">2.25<br> (180ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (80ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.18<br> (94ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="literal">^[a-zA-Z]{1,2}[0-9][0-9A-Za-z]{0,1} {0,1}[0-9][A-Za-z]{2}$</code><br>
|
||||
<code class="literal">EH10 2QQ</code>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">2.54<br> (229ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">2.39<br> (215ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (90ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.16<br> (104ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="literal">^[a-zA-Z]{1,2}[0-9][0-9A-Za-z]{0,1} {0,1}[0-9][A-Za-z]{2}$</code><br>
|
||||
<code class="literal">G1 1AA</code>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">2.46<br> (219ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">2.39<br> (213ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (89ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.18<br> (105ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="literal">^[a-zA-Z]{1,2}[0-9][0-9A-Za-z]{0,1} {0,1}[0-9][A-Za-z]{2}$</code><br>
|
||||
<code class="literal">SW1 1ZZ</code>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">2.51<br> (228ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">2.31<br> (210ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (91ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.12<br> (102ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="literal">abc</code><br> <code class="literal">abc</code>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">1.92<br> (113ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">2.12<br> (125ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.07<br> (63ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (59ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table></div>
|
||||
</div>
|
||||
<br class="table-break">
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 1998-2013 John Maddock<p>
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
|
||||
</p>
|
||||
</div></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="section_Testing_simple_Perl_matches_platform_Windows_x64_compiler_Microsoft_Visual_C_version_14_0_.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../performance.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="section_Testing_simple_leftmost_longest_matches_platform_Windows_x64_compiler_Microsoft_Visual_C_version_14_0_.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
+328
@@ -0,0 +1,328 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
||||
<title>Testing simple leftmost-longest matches (platform = Windows x64, compiler = Microsoft Visual C++ version 14.0)</title>
|
||||
<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.77.1">
|
||||
<link rel="home" href="../../../index.html" title="Boost.Regex 5.0.1">
|
||||
<link rel="up" href="../performance.html" title="Performance">
|
||||
<link rel="prev" href="section_Testing_simple_Perl_matches_platform_linux_compiler_GNU_C_version_5_1_0_.html" title="Testing simple Perl matches (platform = linux, compiler = GNU C++ version 5.1.0)">
|
||||
<link rel="next" href="section_Testing_simple_leftmost_longest_matches_platform_linux_compiler_GNU_C_version_5_1_0_.html" title="Testing simple leftmost-longest matches (platform = linux, compiler = GNU C++ version 5.1.0)">
|
||||
</head>
|
||||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
||||
<table cellpadding="2" width="100%"><tr>
|
||||
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td>
|
||||
<td align="center"><a href="../../../../../../../index.html">Home</a></td>
|
||||
<td align="center"><a href="../../../../../../../libs/libraries.htm">Libraries</a></td>
|
||||
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
|
||||
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
|
||||
<td align="center"><a href="../../../../../../../more/index.htm">More</a></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="section_Testing_simple_Perl_matches_platform_linux_compiler_GNU_C_version_5_1_0_.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../performance.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="section_Testing_simple_leftmost_longest_matches_platform_linux_compiler_GNU_C_version_5_1_0_.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="titlepage"><div><div><h4 class="title">
|
||||
<a name="boost_regex.background_information.performance.section_Testing_simple_leftmost_longest_matches_platform_Windows_x64_compiler_Microsoft_Visual_C_version_14_0_"></a><a class="link" href="section_Testing_simple_leftmost_longest_matches_platform_Windows_x64_compiler_Microsoft_Visual_C_version_14_0_.html" title="Testing simple leftmost-longest matches (platform = Windows x64, compiler = Microsoft Visual C++ version 14.0)">Testing
|
||||
simple leftmost-longest matches (platform = Windows x64, compiler = Microsoft
|
||||
Visual C++ version 14.0)</a>
|
||||
</h4></div></div></div>
|
||||
<div class="table">
|
||||
<a name="boost_regex.background_information.performance.section_Testing_simple_leftmost_longest_matches_platform_Windows_x64_compiler_Microsoft_Visual_C_version_14_0_.table_Testing_simple_leftmost_longest_matches_platform_Windows_x64_compiler_Microsoft_Visual_C_version_14_0_"></a><p class="title"><b>Table 14. Testing simple leftmost-longest matches (platform = Windows x64,
|
||||
compiler = Microsoft Visual C++ version 14.0)</b></p>
|
||||
<div class="table-contents"><table class="table" summary="Testing simple leftmost-longest matches (platform = Windows x64,
|
||||
compiler = Microsoft Visual C++ version 14.0)">
|
||||
<colgroup>
|
||||
<col>
|
||||
<col>
|
||||
<col>
|
||||
</colgroup>
|
||||
<thead><tr>
|
||||
<th>
|
||||
<p>
|
||||
Expression<br> Text
|
||||
</p>
|
||||
</th>
|
||||
<th>
|
||||
<p>
|
||||
boost 1.60
|
||||
</p>
|
||||
</th>
|
||||
<th>
|
||||
<p>
|
||||
std::regex
|
||||
</p>
|
||||
</th>
|
||||
</tr></thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="literal">([[:digit:]]{4}[- ]){3}[[:digit:]]{3,4}</code><br>
|
||||
<code class="literal">1234-5678-1234-456</code>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (490ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="red">6.88<br> (3372ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="literal">^([0-9]+)(\-| |$)(.*)$</code><br> <code class="literal">100-
|
||||
this is a line of ftp response which contains a message string</code>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (554ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="grey">-</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="literal">^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\
|
||||
...</code><br> <code class="literal">bob.smith@foo.tv</code>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (614ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="grey">-</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="literal">^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\
|
||||
...</code><br> <code class="literal">foo12@foo.edu</code>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (596ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="grey">-</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="literal">^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\
|
||||
...</code><br> <code class="literal">john@johnmaddock.co.uk</code>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (748ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="grey">-</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="literal">^[-+]?[[:digit:]]*\.?[[:digit:]]*$</code><br>
|
||||
<code class="literal">+3.14159</code>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (372ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="red">9.77<br> (3635ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="literal">^[-+]?[[:digit:]]*\.?[[:digit:]]*$</code><br>
|
||||
<code class="literal">-3.14159</code>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (367ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="red">9.84<br> (3613ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="literal">^[-+]?[[:digit:]]*\.?[[:digit:]]*$</code><br>
|
||||
<code class="literal">123</code>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (444ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="red">8.45<br> (3754ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="literal">^[[:digit:]]{1,2}/[[:digit:]]{1,2}/[[:digit:]]{4}$</code><br>
|
||||
<code class="literal">12/12/2001</code>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (325ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="red">5.19<br> (1687ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="literal">^[[:digit:]]{1,2}/[[:digit:]]{1,2}/[[:digit:]]{4}$</code><br>
|
||||
<code class="literal">4/1/2001</code>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (308ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="red">5.39<br> (1660ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="literal">^[a-zA-Z]{1,2}[0-9][0-9A-Za-z]{0,1} {0,1}[0-9][A-Za-z]{2}$</code><br>
|
||||
<code class="literal">EH10 2QQ</code>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (356ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="red">6.78<br> (2415ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="literal">^[a-zA-Z]{1,2}[0-9][0-9A-Za-z]{0,1} {0,1}[0-9][A-Za-z]{2}$</code><br>
|
||||
<code class="literal">G1 1AA</code>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (315ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="red">6.14<br> (1935ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="literal">^[a-zA-Z]{1,2}[0-9][0-9A-Za-z]{0,1} {0,1}[0-9][A-Za-z]{2}$</code><br>
|
||||
<code class="literal">SW1 1ZZ</code>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (346ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="red">5.68<br> (1967ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="literal">abc</code><br> <code class="literal">abc</code>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (287ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">2.32<br> (667ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table></div>
|
||||
</div>
|
||||
<br class="table-break">
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 1998-2013 John Maddock<p>
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
|
||||
</p>
|
||||
</div></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="section_Testing_simple_Perl_matches_platform_linux_compiler_GNU_C_version_5_1_0_.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../performance.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="section_Testing_simple_leftmost_longest_matches_platform_linux_compiler_GNU_C_version_5_1_0_.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
+404
@@ -0,0 +1,404 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
||||
<title>Testing simple leftmost-longest matches (platform = linux, compiler = GNU C++ version 5.1.0)</title>
|
||||
<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.77.1">
|
||||
<link rel="home" href="../../../index.html" title="Boost.Regex 5.0.1">
|
||||
<link rel="up" href="../performance.html" title="Performance">
|
||||
<link rel="prev" href="section_Testing_simple_leftmost_longest_matches_platform_Windows_x64_compiler_Microsoft_Visual_C_version_14_0_.html" title="Testing simple leftmost-longest matches (platform = Windows x64, compiler = Microsoft Visual C++ version 14.0)">
|
||||
<link rel="next" href="../standards.html" title="Standards Conformance">
|
||||
</head>
|
||||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
||||
<table cellpadding="2" width="100%"><tr>
|
||||
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td>
|
||||
<td align="center"><a href="../../../../../../../index.html">Home</a></td>
|
||||
<td align="center"><a href="../../../../../../../libs/libraries.htm">Libraries</a></td>
|
||||
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
|
||||
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
|
||||
<td align="center"><a href="../../../../../../../more/index.htm">More</a></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="section_Testing_simple_leftmost_longest_matches_platform_Windows_x64_compiler_Microsoft_Visual_C_version_14_0_.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../performance.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="../standards.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="titlepage"><div><div><h4 class="title">
|
||||
<a name="boost_regex.background_information.performance.section_Testing_simple_leftmost_longest_matches_platform_linux_compiler_GNU_C_version_5_1_0_"></a><a class="link" href="section_Testing_simple_leftmost_longest_matches_platform_linux_compiler_GNU_C_version_5_1_0_.html" title="Testing simple leftmost-longest matches (platform = linux, compiler = GNU C++ version 5.1.0)">Testing
|
||||
simple leftmost-longest matches (platform = linux, compiler = GNU C++ version
|
||||
5.1.0)</a>
|
||||
</h4></div></div></div>
|
||||
<div class="table">
|
||||
<a name="boost_regex.background_information.performance.section_Testing_simple_leftmost_longest_matches_platform_linux_compiler_GNU_C_version_5_1_0_.table_Testing_simple_leftmost_longest_matches_platform_linux_compiler_GNU_C_version_5_1_0_"></a><p class="title"><b>Table 15. Testing simple leftmost-longest matches (platform = linux, compiler
|
||||
= GNU C++ version 5.1.0)</b></p>
|
||||
<div class="table-contents"><table class="table" summary="Testing simple leftmost-longest matches (platform = linux, compiler
|
||||
= GNU C++ version 5.1.0)">
|
||||
<colgroup>
|
||||
<col>
|
||||
<col>
|
||||
<col>
|
||||
<col>
|
||||
</colgroup>
|
||||
<thead><tr>
|
||||
<th>
|
||||
<p>
|
||||
Expression<br> Text
|
||||
</p>
|
||||
</th>
|
||||
<th>
|
||||
<p>
|
||||
std::regex
|
||||
</p>
|
||||
</th>
|
||||
<th>
|
||||
<p>
|
||||
boost 1.59
|
||||
</p>
|
||||
</th>
|
||||
<th>
|
||||
<p>
|
||||
POSIX
|
||||
</p>
|
||||
</th>
|
||||
</tr></thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="literal">([[:digit:]]{4}[- ]){3}[[:digit:]]{3,4}</code><br>
|
||||
<code class="literal">1234-5678-1234-456</code>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (431ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">1.25<br> (537ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">3.45<br> (1486ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="literal">^([0-9]+)(\-| |$)(.*)$</code><br> <code class="literal">100-
|
||||
this is a line of ftp response which contains a message string</code>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="red">4.60<br> (2203ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (479ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="red">12.80<br> (6133ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="literal">^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\
|
||||
...</code><br> <code class="literal">bob.smith@foo.tv</code>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">1.28<br> (869ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (681ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">2.61<br> (1775ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="literal">^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\
|
||||
...</code><br> <code class="literal">foo12@foo.edu</code>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.11<br> (752ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (675ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">2.44<br> (1644ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="literal">^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\
|
||||
...</code><br> <code class="literal">john@johnmaddock.co.uk</code>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">1.24<br> (1116ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (899ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">2.61<br> (2342ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="literal">^[-+]?[[:digit:]]*\.?[[:digit:]]*$</code><br>
|
||||
<code class="literal">+3.14159</code>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">1.61<br> (339ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">1.76<br> (370ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (210ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="literal">^[-+]?[[:digit:]]*\.?[[:digit:]]*$</code><br>
|
||||
<code class="literal">-3.14159</code>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">1.66<br> (342ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">1.79<br> (368ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (206ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="literal">^[-+]?[[:digit:]]*\.?[[:digit:]]*$</code><br>
|
||||
<code class="literal">123</code>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">1.69<br> (248ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">3.70<br> (544ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (147ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="literal">^[[:digit:]]{1,2}/[[:digit:]]{1,2}/[[:digit:]]{4}$</code><br>
|
||||
<code class="literal">12/12/2001</code>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">2.23<br> (256ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">2.63<br> (303ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (115ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="literal">^[[:digit:]]{1,2}/[[:digit:]]{1,2}/[[:digit:]]{4}$</code><br>
|
||||
<code class="literal">4/1/2001</code>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">1.97<br> (213ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">2.70<br> (292ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (108ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="literal">^[a-zA-Z]{1,2}[0-9][0-9A-Za-z]{0,1} {0,1}[0-9][A-Za-z]{2}$</code><br>
|
||||
<code class="literal">EH10 2QQ</code>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">2.38<br> (255ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">3.31<br> (354ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (107ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="literal">^[a-zA-Z]{1,2}[0-9][0-9A-Za-z]{0,1} {0,1}[0-9][A-Za-z]{2}$</code><br>
|
||||
<code class="literal">G1 1AA</code>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">2.12<br> (216ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">2.90<br> (296ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (102ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="literal">^[a-zA-Z]{1,2}[0-9][0-9A-Za-z]{0,1} {0,1}[0-9][A-Za-z]{2}$</code><br>
|
||||
<code class="literal">SW1 1ZZ</code>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">2.25<br> (234ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">2.89<br> (301ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (104ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="literal">abc</code><br> <code class="literal">abc</code>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">1.20<br> (113ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="blue">2.38<br> (224ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<span class="green">1.00<br> (94ns)</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table></div>
|
||||
</div>
|
||||
<br class="table-break">
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 1998-2013 John Maddock<p>
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
|
||||
</p>
|
||||
</div></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="section_Testing_simple_leftmost_longest_matches_platform_Windows_x64_compiler_Microsoft_Visual_C_version_14_0_.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../performance.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="../standards.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -6,7 +6,7 @@
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.77.1">
|
||||
<link rel="home" href="../../index.html" title="Boost.Regex 5.0.1">
|
||||
<link rel="up" href="../background_information.html" title="Background Information">
|
||||
<link rel="prev" href="performance.html" title="Performance">
|
||||
<link rel="prev" href="performance/section_Testing_simple_leftmost_longest_matches_platform_linux_compiler_GNU_C_version_5_1_0_.html" title="Testing simple leftmost-longest matches (platform = linux, compiler = GNU C++ version 5.1.0)">
|
||||
<link rel="next" href="redist.html" title="Redistributables">
|
||||
</head>
|
||||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
||||
@@ -20,7 +20,7 @@
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="performance.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../background_information.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="redist.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
<a accesskey="p" href="performance/section_Testing_simple_leftmost_longest_matches_platform_linux_compiler_GNU_C_version_5_1_0_.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../background_information.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="redist.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="titlepage"><div><div><h3 class="title">
|
||||
@@ -29,7 +29,7 @@
|
||||
</h3></div></div></div>
|
||||
<h5>
|
||||
<a name="boost_regex.background_information.standards.h0"></a>
|
||||
<span class="phrase"><a name="boost_regex.background_information.standards.c__"></a></span><a class="link" href="standards.html#boost_regex.background_information.standards.c__">C++</a>
|
||||
<span class="phrase"><a name="boost_regex.background_information.standards.c"></a></span><a class="link" href="standards.html#boost_regex.background_information.standards.c">C++</a>
|
||||
</h5>
|
||||
<p>
|
||||
Boost.Regex is intended to conform to the <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1836.pdf" target="_top">Technical
|
||||
@@ -37,7 +37,7 @@
|
||||
</p>
|
||||
<h5>
|
||||
<a name="boost_regex.background_information.standards.h1"></a>
|
||||
<span class="phrase"><a name="boost_regex.background_information.standards.ecmascript___javascript"></a></span><a class="link" href="standards.html#boost_regex.background_information.standards.ecmascript___javascript">ECMAScript
|
||||
<span class="phrase"><a name="boost_regex.background_information.standards.ecmascript_javascript"></a></span><a class="link" href="standards.html#boost_regex.background_information.standards.ecmascript_javascript">ECMAScript
|
||||
/ JavaScript</a>
|
||||
</h5>
|
||||
<p>
|
||||
@@ -568,7 +568,7 @@
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="performance.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../background_information.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="redist.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
<a accesskey="p" href="performance/section_Testing_simple_leftmost_longest_matches_platform_linux_compiler_GNU_C_version_5_1_0_.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../background_information.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="redist.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
</p>
|
||||
<h5>
|
||||
<a name="boost_regex.install.h1"></a>
|
||||
<span class="phrase"><a name="boost_regex.install.building_with_unicode_and_icu_support"></a></span><a class="link" href="install.html#boost_regex.install.building_with_unicode_and_icu_support">Building
|
||||
<span class="phrase"><a name="boost_regex.install.building_with_unicode_and_icu_su"></a></span><a class="link" href="install.html#boost_regex.install.building_with_unicode_and_icu_su">Building
|
||||
With Unicode and ICU Support</a>
|
||||
</h5>
|
||||
<p>
|
||||
|
||||
@@ -325,7 +325,7 @@
|
||||
<code class="computeroutput"><span class="identifier">basic_regex</span></code>.
|
||||
</p>
|
||||
<div class="table">
|
||||
<a name="boost_regex.ref.basic_regex.t0"></a><p class="title"><b>Table 1. basic_regex default construction postconditions</b></p>
|
||||
<a name="boost_regex.ref.basic_regex.basic_regex_default_construction"></a><p class="title"><b>Table 1. basic_regex default construction postconditions</b></p>
|
||||
<div class="table-contents"><table class="table" summary="basic_regex default construction postconditions">
|
||||
<colgroup>
|
||||
<col>
|
||||
@@ -403,7 +403,7 @@
|
||||
flags</a> specified in <span class="emphasis"><em>f</em></span>.
|
||||
</p>
|
||||
<div class="table">
|
||||
<a name="boost_regex.ref.basic_regex.t1"></a><p class="title"><b>Table 2. Postconditions for basic_regex construction</b></p>
|
||||
<a name="boost_regex.ref.basic_regex.postconditions_for_basic_regex_c"></a><p class="title"><b>Table 2. Postconditions for basic_regex construction</b></p>
|
||||
<div class="table-contents"><table class="table" summary="Postconditions for basic_regex construction">
|
||||
<colgroup>
|
||||
<col>
|
||||
@@ -506,7 +506,7 @@
|
||||
specified in <span class="emphasis"><em>f</em></span>.
|
||||
</p>
|
||||
<div class="table">
|
||||
<a name="boost_regex.ref.basic_regex.t2"></a><p class="title"><b>Table 3. Postconditions for basic_regex construction</b></p>
|
||||
<a name="boost_regex.ref.basic_regex.postconditions_for_basic_regex_0"></a><p class="title"><b>Table 3. Postconditions for basic_regex construction</b></p>
|
||||
<div class="table-contents"><table class="table" summary="Postconditions for basic_regex construction">
|
||||
<colgroup>
|
||||
<col>
|
||||
@@ -608,7 +608,7 @@
|
||||
according the option flags specified in <span class="emphasis"><em>f</em></span>.
|
||||
</p>
|
||||
<div class="table">
|
||||
<a name="boost_regex.ref.basic_regex.t3"></a><p class="title"><b>Table 4. Postconditions for basic_regex construction</b></p>
|
||||
<a name="boost_regex.ref.basic_regex.postconditions_for_basic_regex_1"></a><p class="title"><b>Table 4. Postconditions for basic_regex construction</b></p>
|
||||
<div class="table-contents"><table class="table" summary="Postconditions for basic_regex construction">
|
||||
<colgroup>
|
||||
<col>
|
||||
@@ -716,7 +716,7 @@
|
||||
flags</a> specified in <span class="emphasis"><em>f</em></span>.
|
||||
</p>
|
||||
<div class="table">
|
||||
<a name="boost_regex.ref.basic_regex.t4"></a><p class="title"><b>Table 5. Postconditions for basic_regex construction</b></p>
|
||||
<a name="boost_regex.ref.basic_regex.postconditions_for_basic_regex_2"></a><p class="title"><b>Table 5. Postconditions for basic_regex construction</b></p>
|
||||
<div class="table-contents"><table class="table" summary="Postconditions for basic_regex construction">
|
||||
<colgroup>
|
||||
<col>
|
||||
@@ -816,7 +816,7 @@
|
||||
flags</a> specified in <span class="emphasis"><em>f</em></span>.
|
||||
</p>
|
||||
<div class="table">
|
||||
<a name="boost_regex.ref.basic_regex.t5"></a><p class="title"><b>Table 6. Postconditions for basic_regex construction</b></p>
|
||||
<a name="boost_regex.ref.basic_regex.postconditions_for_basic_regex_3"></a><p class="title"><b>Table 6. Postconditions for basic_regex construction</b></p>
|
||||
<div class="table-contents"><table class="table" summary="Postconditions for basic_regex construction">
|
||||
<colgroup>
|
||||
<col>
|
||||
@@ -1002,7 +1002,7 @@
|
||||
in <span class="emphasis"><em>f</em></span>.
|
||||
</p>
|
||||
<div class="table">
|
||||
<a name="boost_regex.ref.basic_regex.t6"></a><p class="title"><b>Table 7. Postconditions for basic_regex::assign</b></p>
|
||||
<a name="boost_regex.ref.basic_regex.postconditions_for_basic_regex_a"></a><p class="title"><b>Table 7. Postconditions for basic_regex::assign</b></p>
|
||||
<div class="table-contents"><table class="table" summary="Postconditions for basic_regex::assign">
|
||||
<colgroup>
|
||||
<col>
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
</p>
|
||||
<h5>
|
||||
<a name="boost_regex.ref.concepts.traits_concept.h0"></a>
|
||||
<span class="phrase"><a name="boost_regex.ref.concepts.traits_concept.minimal_requirements_"></a></span><a class="link" href="traits_concept.html#boost_regex.ref.concepts.traits_concept.minimal_requirements_">Minimal
|
||||
<span class="phrase"><a name="boost_regex.ref.concepts.traits_concept.minimal_requirements"></a></span><a class="link" href="traits_concept.html#boost_regex.ref.concepts.traits_concept.minimal_requirements">Minimal
|
||||
requirements.</a>
|
||||
</h5>
|
||||
<p>
|
||||
|
||||
@@ -31,11 +31,7 @@
|
||||
<a name="boost_regex.ref.internal_details.uni_iter.h0"></a>
|
||||
<span class="phrase"><a name="boost_regex.ref.internal_details.uni_iter.synopsis"></a></span><a class="link" href="uni_iter.html#boost_regex.ref.internal_details.uni_iter.synopsis">Synopsis</a>
|
||||
</h5>
|
||||
<p>
|
||||
</p>
|
||||
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">regex</span><span class="special">/</span><span class="identifier">pending</span><span class="special">/</span><span class="identifier">unicode_iterator</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></pre>
|
||||
<p>
|
||||
</p>
|
||||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">BaseIterator</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">U16Type</span> <span class="special">=</span> <span class="special">::</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">uint16_t</span><span class="special">></span>
|
||||
<span class="keyword">class</span> <span class="identifier">u32_to_u16_iterator</span><span class="special">;</span>
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
<p>
|
||||
In order to use this header you will need the <a href="http://www.ibm.com/software/globalization/icu/" target="_top">ICU
|
||||
library</a>, and you will need to have built the Boost.Regex library
|
||||
with <a class="link" href="../../../install.html#boost_regex.install.building_with_unicode_and_icu_support">ICU
|
||||
with <a class="link" href="../../../install.html#boost_regex.install.building_with_unicode_and_icu_su">ICU
|
||||
support enabled</a>.
|
||||
</p>
|
||||
<p>
|
||||
|
||||
@@ -83,7 +83,7 @@
|
||||
</pre>
|
||||
<h5>
|
||||
<a name="boost_regex.ref.non_std_strings.mfc_strings.mfc_algo.h1"></a>
|
||||
<span class="phrase"><a name="boost_regex.ref.non_std_strings.mfc_strings.mfc_algo.regex_match__second_overload_"></a></span><a class="link" href="mfc_algo.html#boost_regex.ref.non_std_strings.mfc_strings.mfc_algo.regex_match__second_overload_">regex_match
|
||||
<span class="phrase"><a name="boost_regex.ref.non_std_strings.mfc_strings.mfc_algo.regex_match_second_overload"></a></span><a class="link" href="mfc_algo.html#boost_regex.ref.non_std_strings.mfc_strings.mfc_algo.regex_match_second_overload">regex_match
|
||||
(second overload)</a>
|
||||
</h5>
|
||||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">charT</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
|
||||
@@ -150,7 +150,7 @@
|
||||
</pre>
|
||||
<h5>
|
||||
<a name="boost_regex.ref.non_std_strings.mfc_strings.mfc_algo.h3"></a>
|
||||
<span class="phrase"><a name="boost_regex.ref.non_std_strings.mfc_strings.mfc_algo.regex_search__second_overload_"></a></span><a class="link" href="mfc_algo.html#boost_regex.ref.non_std_strings.mfc_strings.mfc_algo.regex_search__second_overload_">regex_search
|
||||
<span class="phrase"><a name="boost_regex.ref.non_std_strings.mfc_strings.mfc_algo.regex_search_second_overload"></a></span><a class="link" href="mfc_algo.html#boost_regex.ref.non_std_strings.mfc_strings.mfc_algo.regex_search_second_overload">regex_search
|
||||
(second overload)</a>
|
||||
</h5>
|
||||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">charT</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
</pre>
|
||||
<h5>
|
||||
<a name="boost_regex.ref.non_std_strings.mfc_strings.mfc_iter.h1"></a>
|
||||
<span class="phrase"><a name="boost_regex.ref.non_std_strings.mfc_strings.mfc_iter.regex_token_iterator_creation_helpers"></a></span><a class="link" href="mfc_iter.html#boost_regex.ref.non_std_strings.mfc_strings.mfc_iter.regex_token_iterator_creation_helpers">regex_token_iterator
|
||||
<span class="phrase"><a name="boost_regex.ref.non_std_strings.mfc_strings.mfc_iter.regex_token_iterator_creation_he"></a></span><a class="link" href="mfc_iter.html#boost_regex.ref.non_std_strings.mfc_strings.mfc_iter.regex_token_iterator_creation_he">regex_token_iterator
|
||||
creation helpers</a>
|
||||
</h5>
|
||||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">charT</span><span class="special">></span>
|
||||
|
||||
@@ -46,8 +46,8 @@
|
||||
<span class="keyword">class</span> <span class="identifier">Allocator</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">charT</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">traits</span><span class="special">></span>
|
||||
<span class="keyword">bool</span> <span class="identifier">regex_search</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">basic_string</span><span class="special"><</span><span class="identifier">charT</span><span class="special">,</span> <span class="identifier">ST</span><span class="special">,</span> <span class="identifier">SA</span><span class="special">>&</span> <span class="identifier">s</span><span class="special">,</span>
|
||||
<span class="identifier">match_results</span><span class="special"><</span>
|
||||
<span class="keyword">typename</span> <span class="identifier">basic_string</span><span class="special"><</span><span class="identifier">charT</span><span class="special">,</span> <span class="identifier">ST</span><span class="special">,</span><span class="identifier">SA</span><span class="special">>::</span><span class="identifier">const_iterator</span><span class="special">,</span>
|
||||
<span class="identifier">Allocator</span><span class="special">>&</span> <span class="identifier">m</span><span class="special">,</span>
|
||||
<span class="keyword">typename</span> <span class="identifier">basic_string</span><span class="special"><</span><span class="identifier">charT</span><span class="special">,</span> <span class="identifier">ST</span><span class="special">,</span><span class="identifier">SA</span><span class="special">>::</span><span class="identifier">const_iterator</span><span class="special">,</span>
|
||||
<span class="identifier">Allocator</span><span class="special">>&</span> <span class="identifier">m</span><span class="special">,</span>
|
||||
<span class="keyword">const</span> <span class="identifier">basic_regex</span><span class="special"><</span><span class="identifier">charT</span><span class="special">,</span> <span class="identifier">traits</span><span class="special">>&</span> <span class="identifier">e</span><span class="special">,</span>
|
||||
<span class="identifier">match_flag_type</span> <span class="identifier">flags</span> <span class="special">=</span> <span class="identifier">match_default</span><span class="special">);</span>
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
<pre class="programlisting">.[{}()\*+?|^$</pre>
|
||||
<h5>
|
||||
<a name="boost_regex.syntax.basic_extended.h2"></a>
|
||||
<span class="phrase"><a name="boost_regex.syntax.basic_extended.wildcard_"></a></span><a class="link" href="basic_extended.html#boost_regex.syntax.basic_extended.wildcard_">Wildcard:</a>
|
||||
<span class="phrase"><a name="boost_regex.syntax.basic_extended.wildcard"></a></span><a class="link" href="basic_extended.html#boost_regex.syntax.basic_extended.wildcard">Wildcard:</a>
|
||||
</h5>
|
||||
<p>
|
||||
The single character '.' when used outside of a character set will match
|
||||
@@ -73,7 +73,7 @@
|
||||
</ul></div>
|
||||
<h5>
|
||||
<a name="boost_regex.syntax.basic_extended.h3"></a>
|
||||
<span class="phrase"><a name="boost_regex.syntax.basic_extended.anchors_"></a></span><a class="link" href="basic_extended.html#boost_regex.syntax.basic_extended.anchors_">Anchors:</a>
|
||||
<span class="phrase"><a name="boost_regex.syntax.basic_extended.anchors"></a></span><a class="link" href="basic_extended.html#boost_regex.syntax.basic_extended.anchors">Anchors:</a>
|
||||
</h5>
|
||||
<p>
|
||||
A '^' character shall match the start of a line when used as the first character
|
||||
@@ -85,7 +85,7 @@
|
||||
</p>
|
||||
<h5>
|
||||
<a name="boost_regex.syntax.basic_extended.h4"></a>
|
||||
<span class="phrase"><a name="boost_regex.syntax.basic_extended.marked_sub_expressions_"></a></span><a class="link" href="basic_extended.html#boost_regex.syntax.basic_extended.marked_sub_expressions_">Marked
|
||||
<span class="phrase"><a name="boost_regex.syntax.basic_extended.marked_sub_expressions"></a></span><a class="link" href="basic_extended.html#boost_regex.syntax.basic_extended.marked_sub_expressions">Marked
|
||||
sub-expressions:</a>
|
||||
</h5>
|
||||
<p>
|
||||
@@ -97,7 +97,7 @@
|
||||
</p>
|
||||
<h5>
|
||||
<a name="boost_regex.syntax.basic_extended.h5"></a>
|
||||
<span class="phrase"><a name="boost_regex.syntax.basic_extended.repeats_"></a></span><a class="link" href="basic_extended.html#boost_regex.syntax.basic_extended.repeats_">Repeats:</a>
|
||||
<span class="phrase"><a name="boost_regex.syntax.basic_extended.repeats"></a></span><a class="link" href="basic_extended.html#boost_regex.syntax.basic_extended.repeats">Repeats:</a>
|
||||
</h5>
|
||||
<p>
|
||||
Any atom (a single character, a marked sub-expression, or a character class)
|
||||
@@ -183,7 +183,7 @@ cab
|
||||
</p>
|
||||
<h5>
|
||||
<a name="boost_regex.syntax.basic_extended.h6"></a>
|
||||
<span class="phrase"><a name="boost_regex.syntax.basic_extended.back_references_"></a></span><a class="link" href="basic_extended.html#boost_regex.syntax.basic_extended.back_references_">Back
|
||||
<span class="phrase"><a name="boost_regex.syntax.basic_extended.back_references"></a></span><a class="link" href="basic_extended.html#boost_regex.syntax.basic_extended.back_references">Back
|
||||
references:</a>
|
||||
</h5>
|
||||
<p>
|
||||
@@ -227,7 +227,7 @@ cab
|
||||
</p>
|
||||
<h5>
|
||||
<a name="boost_regex.syntax.basic_extended.h8"></a>
|
||||
<span class="phrase"><a name="boost_regex.syntax.basic_extended.character_sets_"></a></span><a class="link" href="basic_extended.html#boost_regex.syntax.basic_extended.character_sets_">Character
|
||||
<span class="phrase"><a name="boost_regex.syntax.basic_extended.character_sets"></a></span><a class="link" href="basic_extended.html#boost_regex.syntax.basic_extended.character_sets">Character
|
||||
sets:</a>
|
||||
</h5>
|
||||
<p>
|
||||
@@ -240,7 +240,8 @@ cab
|
||||
</p>
|
||||
<h6>
|
||||
<a name="boost_regex.syntax.basic_extended.h9"></a>
|
||||
<span class="phrase"><a name="boost_regex.syntax.basic_extended.single_characters_"></a></span><a class="link" href="basic_extended.html#boost_regex.syntax.basic_extended.single_characters_">Single characters:</a>
|
||||
<span class="phrase"><a name="boost_regex.syntax.basic_extended.single_characters"></a></span><a class="link" href="basic_extended.html#boost_regex.syntax.basic_extended.single_characters">Single
|
||||
characters:</a>
|
||||
</h6>
|
||||
<p>
|
||||
For example <code class="computeroutput"><span class="special">[</span><span class="identifier">abc</span><span class="special">]</span></code>, will match any of the characters 'a', 'b',
|
||||
@@ -248,7 +249,7 @@ cab
|
||||
</p>
|
||||
<h6>
|
||||
<a name="boost_regex.syntax.basic_extended.h10"></a>
|
||||
<span class="phrase"><a name="boost_regex.syntax.basic_extended.character_ranges_"></a></span><a class="link" href="basic_extended.html#boost_regex.syntax.basic_extended.character_ranges_">Character
|
||||
<span class="phrase"><a name="boost_regex.syntax.basic_extended.character_ranges"></a></span><a class="link" href="basic_extended.html#boost_regex.syntax.basic_extended.character_ranges">Character
|
||||
ranges:</a>
|
||||
</h6>
|
||||
<p>
|
||||
@@ -264,7 +265,7 @@ cab
|
||||
</p>
|
||||
<h6>
|
||||
<a name="boost_regex.syntax.basic_extended.h11"></a>
|
||||
<span class="phrase"><a name="boost_regex.syntax.basic_extended.negation_"></a></span><a class="link" href="basic_extended.html#boost_regex.syntax.basic_extended.negation_">Negation:</a>
|
||||
<span class="phrase"><a name="boost_regex.syntax.basic_extended.negation"></a></span><a class="link" href="basic_extended.html#boost_regex.syntax.basic_extended.negation">Negation:</a>
|
||||
</h6>
|
||||
<p>
|
||||
If the bracket-expression begins with the ^ character, then it matches the
|
||||
@@ -273,7 +274,7 @@ cab
|
||||
</p>
|
||||
<h6>
|
||||
<a name="boost_regex.syntax.basic_extended.h12"></a>
|
||||
<span class="phrase"><a name="boost_regex.syntax.basic_extended.character_classes_"></a></span><a class="link" href="basic_extended.html#boost_regex.syntax.basic_extended.character_classes_">Character
|
||||
<span class="phrase"><a name="boost_regex.syntax.basic_extended.character_classes"></a></span><a class="link" href="basic_extended.html#boost_regex.syntax.basic_extended.character_classes">Character
|
||||
classes:</a>
|
||||
</h6>
|
||||
<p>
|
||||
@@ -283,7 +284,7 @@ cab
|
||||
</p>
|
||||
<h6>
|
||||
<a name="boost_regex.syntax.basic_extended.h13"></a>
|
||||
<span class="phrase"><a name="boost_regex.syntax.basic_extended.collating_elements_"></a></span><a class="link" href="basic_extended.html#boost_regex.syntax.basic_extended.collating_elements_">Collating
|
||||
<span class="phrase"><a name="boost_regex.syntax.basic_extended.collating_elements"></a></span><a class="link" href="basic_extended.html#boost_regex.syntax.basic_extended.collating_elements">Collating
|
||||
Elements:</a>
|
||||
</h6>
|
||||
<p>
|
||||
@@ -311,7 +312,7 @@ cab
|
||||
</p>
|
||||
<h6>
|
||||
<a name="boost_regex.syntax.basic_extended.h14"></a>
|
||||
<span class="phrase"><a name="boost_regex.syntax.basic_extended.equivalence_classes_"></a></span><a class="link" href="basic_extended.html#boost_regex.syntax.basic_extended.equivalence_classes_">Equivalence
|
||||
<span class="phrase"><a name="boost_regex.syntax.basic_extended.equivalence_classes"></a></span><a class="link" href="basic_extended.html#boost_regex.syntax.basic_extended.equivalence_classes">Equivalence
|
||||
classes:</a>
|
||||
</h6>
|
||||
<p>
|
||||
@@ -328,7 +329,7 @@ cab
|
||||
</p>
|
||||
<h6>
|
||||
<a name="boost_regex.syntax.basic_extended.h15"></a>
|
||||
<span class="phrase"><a name="boost_regex.syntax.basic_extended.combinations_"></a></span><a class="link" href="basic_extended.html#boost_regex.syntax.basic_extended.combinations_">Combinations:</a>
|
||||
<span class="phrase"><a name="boost_regex.syntax.basic_extended.combinations"></a></span><a class="link" href="basic_extended.html#boost_regex.syntax.basic_extended.combinations">Combinations:</a>
|
||||
</h6>
|
||||
<p>
|
||||
All of the above can be combined in one character set declaration, for example:
|
||||
@@ -362,7 +363,7 @@ cab
|
||||
</p>
|
||||
<h6>
|
||||
<a name="boost_regex.syntax.basic_extended.h17"></a>
|
||||
<span class="phrase"><a name="boost_regex.syntax.basic_extended.escapes_matching_a_specific_character"></a></span><a class="link" href="basic_extended.html#boost_regex.syntax.basic_extended.escapes_matching_a_specific_character">Escapes
|
||||
<span class="phrase"><a name="boost_regex.syntax.basic_extended.escapes_matching_a_specific_char"></a></span><a class="link" href="basic_extended.html#boost_regex.syntax.basic_extended.escapes_matching_a_specific_char">Escapes
|
||||
matching a specific character</a>
|
||||
</h6>
|
||||
<p>
|
||||
@@ -551,7 +552,7 @@ cab
|
||||
</table></div>
|
||||
<h6>
|
||||
<a name="boost_regex.syntax.basic_extended.h18"></a>
|
||||
<span class="phrase"><a name="boost_regex.syntax.basic_extended._quot_single_character_quot__character_classes_"></a></span><a class="link" href="basic_extended.html#boost_regex.syntax.basic_extended._quot_single_character_quot__character_classes_">"Single
|
||||
<span class="phrase"><a name="boost_regex.syntax.basic_extended.single_character_character_class"></a></span><a class="link" href="basic_extended.html#boost_regex.syntax.basic_extended.single_character_character_class">"Single
|
||||
character" character classes:</a>
|
||||
</h6>
|
||||
<p>
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
<pre class="programlisting">.[\*^$</pre>
|
||||
<h5>
|
||||
<a name="boost_regex.syntax.basic_syntax.h2"></a>
|
||||
<span class="phrase"><a name="boost_regex.syntax.basic_syntax.wildcard_"></a></span><a class="link" href="basic_syntax.html#boost_regex.syntax.basic_syntax.wildcard_">Wildcard:</a>
|
||||
<span class="phrase"><a name="boost_regex.syntax.basic_syntax.wildcard"></a></span><a class="link" href="basic_syntax.html#boost_regex.syntax.basic_syntax.wildcard">Wildcard:</a>
|
||||
</h5>
|
||||
<p>
|
||||
The single character '.' when used outside of a character set will match
|
||||
@@ -72,7 +72,7 @@
|
||||
</ul></div>
|
||||
<h5>
|
||||
<a name="boost_regex.syntax.basic_syntax.h3"></a>
|
||||
<span class="phrase"><a name="boost_regex.syntax.basic_syntax.anchors_"></a></span><a class="link" href="basic_syntax.html#boost_regex.syntax.basic_syntax.anchors_">Anchors:</a>
|
||||
<span class="phrase"><a name="boost_regex.syntax.basic_syntax.anchors"></a></span><a class="link" href="basic_syntax.html#boost_regex.syntax.basic_syntax.anchors">Anchors:</a>
|
||||
</h5>
|
||||
<p>
|
||||
A '^' character shall match the start of a line when used as the first character
|
||||
@@ -84,8 +84,7 @@
|
||||
</p>
|
||||
<h5>
|
||||
<a name="boost_regex.syntax.basic_syntax.h4"></a>
|
||||
<span class="phrase"><a name="boost_regex.syntax.basic_syntax.marked_sub_expressions_"></a></span><a class="link" href="basic_syntax.html#boost_regex.syntax.basic_syntax.marked_sub_expressions_">Marked
|
||||
sub-expressions:</a>
|
||||
<span class="phrase"><a name="boost_regex.syntax.basic_syntax.marked_sub_expressions"></a></span><a class="link" href="basic_syntax.html#boost_regex.syntax.basic_syntax.marked_sub_expressions">Marked sub-expressions:</a>
|
||||
</h5>
|
||||
<p>
|
||||
A section beginning <code class="computeroutput"><span class="special">\(</span></code> and ending
|
||||
@@ -96,7 +95,7 @@
|
||||
</p>
|
||||
<h5>
|
||||
<a name="boost_regex.syntax.basic_syntax.h5"></a>
|
||||
<span class="phrase"><a name="boost_regex.syntax.basic_syntax.repeats_"></a></span><a class="link" href="basic_syntax.html#boost_regex.syntax.basic_syntax.repeats_">Repeats:</a>
|
||||
<span class="phrase"><a name="boost_regex.syntax.basic_syntax.repeats"></a></span><a class="link" href="basic_syntax.html#boost_regex.syntax.basic_syntax.repeats">Repeats:</a>
|
||||
</h5>
|
||||
<p>
|
||||
Any atom (a single character, a marked sub-expression, or a character class)
|
||||
@@ -154,7 +153,7 @@ aaaa
|
||||
</p>
|
||||
<h5>
|
||||
<a name="boost_regex.syntax.basic_syntax.h6"></a>
|
||||
<span class="phrase"><a name="boost_regex.syntax.basic_syntax.back_references_"></a></span><a class="link" href="basic_syntax.html#boost_regex.syntax.basic_syntax.back_references_">Back
|
||||
<span class="phrase"><a name="boost_regex.syntax.basic_syntax.back_references"></a></span><a class="link" href="basic_syntax.html#boost_regex.syntax.basic_syntax.back_references">Back
|
||||
references:</a>
|
||||
</h5>
|
||||
<p>
|
||||
@@ -173,7 +172,7 @@ aaaa
|
||||
<pre class="programlisting">aaabba</pre>
|
||||
<h5>
|
||||
<a name="boost_regex.syntax.basic_syntax.h7"></a>
|
||||
<span class="phrase"><a name="boost_regex.syntax.basic_syntax.character_sets_"></a></span><a class="link" href="basic_syntax.html#boost_regex.syntax.basic_syntax.character_sets_">Character
|
||||
<span class="phrase"><a name="boost_regex.syntax.basic_syntax.character_sets"></a></span><a class="link" href="basic_syntax.html#boost_regex.syntax.basic_syntax.character_sets">Character
|
||||
sets:</a>
|
||||
</h5>
|
||||
<p>
|
||||
@@ -186,7 +185,7 @@ aaaa
|
||||
</p>
|
||||
<h6>
|
||||
<a name="boost_regex.syntax.basic_syntax.h8"></a>
|
||||
<span class="phrase"><a name="boost_regex.syntax.basic_syntax.single_characters_"></a></span><a class="link" href="basic_syntax.html#boost_regex.syntax.basic_syntax.single_characters_">Single
|
||||
<span class="phrase"><a name="boost_regex.syntax.basic_syntax.single_characters"></a></span><a class="link" href="basic_syntax.html#boost_regex.syntax.basic_syntax.single_characters">Single
|
||||
characters:</a>
|
||||
</h6>
|
||||
<p>
|
||||
@@ -195,7 +194,7 @@ aaaa
|
||||
</p>
|
||||
<h6>
|
||||
<a name="boost_regex.syntax.basic_syntax.h9"></a>
|
||||
<span class="phrase"><a name="boost_regex.syntax.basic_syntax.character_ranges_"></a></span><a class="link" href="basic_syntax.html#boost_regex.syntax.basic_syntax.character_ranges_">Character
|
||||
<span class="phrase"><a name="boost_regex.syntax.basic_syntax.character_ranges"></a></span><a class="link" href="basic_syntax.html#boost_regex.syntax.basic_syntax.character_ranges">Character
|
||||
ranges:</a>
|
||||
</h6>
|
||||
<p>
|
||||
@@ -211,7 +210,7 @@ aaaa
|
||||
</p>
|
||||
<h6>
|
||||
<a name="boost_regex.syntax.basic_syntax.h10"></a>
|
||||
<span class="phrase"><a name="boost_regex.syntax.basic_syntax.negation_"></a></span><a class="link" href="basic_syntax.html#boost_regex.syntax.basic_syntax.negation_">Negation:</a>
|
||||
<span class="phrase"><a name="boost_regex.syntax.basic_syntax.negation"></a></span><a class="link" href="basic_syntax.html#boost_regex.syntax.basic_syntax.negation">Negation:</a>
|
||||
</h6>
|
||||
<p>
|
||||
If the bracket-expression begins with the ^ character, then it matches the
|
||||
@@ -220,7 +219,7 @@ aaaa
|
||||
</p>
|
||||
<h6>
|
||||
<a name="boost_regex.syntax.basic_syntax.h11"></a>
|
||||
<span class="phrase"><a name="boost_regex.syntax.basic_syntax.character_classes_"></a></span><a class="link" href="basic_syntax.html#boost_regex.syntax.basic_syntax.character_classes_">Character
|
||||
<span class="phrase"><a name="boost_regex.syntax.basic_syntax.character_classes"></a></span><a class="link" href="basic_syntax.html#boost_regex.syntax.basic_syntax.character_classes">Character
|
||||
classes:</a>
|
||||
</h6>
|
||||
<p>
|
||||
@@ -230,7 +229,7 @@ aaaa
|
||||
</p>
|
||||
<h6>
|
||||
<a name="boost_regex.syntax.basic_syntax.h12"></a>
|
||||
<span class="phrase"><a name="boost_regex.syntax.basic_syntax.collating_elements_"></a></span><a class="link" href="basic_syntax.html#boost_regex.syntax.basic_syntax.collating_elements_">Collating
|
||||
<span class="phrase"><a name="boost_regex.syntax.basic_syntax.collating_elements"></a></span><a class="link" href="basic_syntax.html#boost_regex.syntax.basic_syntax.collating_elements">Collating
|
||||
Elements:</a>
|
||||
</h6>
|
||||
<p>
|
||||
@@ -259,7 +258,7 @@ aaaa
|
||||
</p>
|
||||
<h6>
|
||||
<a name="boost_regex.syntax.basic_syntax.h13"></a>
|
||||
<span class="phrase"><a name="boost_regex.syntax.basic_syntax.equivalence_classes_"></a></span><a class="link" href="basic_syntax.html#boost_regex.syntax.basic_syntax.equivalence_classes_">Equivalence
|
||||
<span class="phrase"><a name="boost_regex.syntax.basic_syntax.equivalence_classes"></a></span><a class="link" href="basic_syntax.html#boost_regex.syntax.basic_syntax.equivalence_classes">Equivalence
|
||||
classes:</a>
|
||||
</h6>
|
||||
<p>
|
||||
@@ -276,7 +275,7 @@ aaaa
|
||||
</p>
|
||||
<h6>
|
||||
<a name="boost_regex.syntax.basic_syntax.h14"></a>
|
||||
<span class="phrase"><a name="boost_regex.syntax.basic_syntax.combinations_"></a></span><a class="link" href="basic_syntax.html#boost_regex.syntax.basic_syntax.combinations_">Combinations:</a>
|
||||
<span class="phrase"><a name="boost_regex.syntax.basic_syntax.combinations"></a></span><a class="link" href="basic_syntax.html#boost_regex.syntax.basic_syntax.combinations">Combinations:</a>
|
||||
</h6>
|
||||
<p>
|
||||
All of the above can be combined in one character set declaration, for example:
|
||||
@@ -381,9 +380,9 @@ aaaa
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
*?
|
||||
</p>
|
||||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
|
||||
?
|
||||
</li></ul></div>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
|
||||
@@ -1,396 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
||||
<title>Character Classes that are Always Supported</title>
|
||||
<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
|
||||
<link rel="home" href="../../../index.html" title="Boost.Regex">
|
||||
<link rel="up" href="../character_classes.html" title="Character Class Names">
|
||||
<link rel="prev" href="../character_classes.html" title="Character Class Names">
|
||||
<link rel="next" href="optional_char_class_names.html" title="Character classes that are supported by Unicode Regular Expressions">
|
||||
</head>
|
||||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
||||
<table cellpadding="2" width="100%"><tr>
|
||||
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td>
|
||||
<td align="center"><a href="../../../../../../../index.html">Home</a></td>
|
||||
<td align="center"><a href="../../../../../../../libs/libraries.htm">Libraries</a></td>
|
||||
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
|
||||
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
|
||||
<td align="center"><a href="../../../../../../../more/index.htm">More</a></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="../character_classes.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../character_classes.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="optional_char_class_names.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
<div class="section boost_regex_syntax_character_classes_std_char_clases">
|
||||
<div class="titlepage"><div><div><h4 class="title">
|
||||
<a name="boost_regex.syntax.character_classes.std_char_clases"></a><a class="link" href="std_char_clases.html" title="Character Classes that are Always Supported">Character
|
||||
Classes that are Always Supported</a>
|
||||
</h4></div></div></div>
|
||||
<p>
|
||||
The following character class names are always supported by Boost.Regex:
|
||||
</p>
|
||||
<div class="informaltable"><table class="table">
|
||||
<colgroup>
|
||||
<col>
|
||||
<col>
|
||||
<col>
|
||||
</colgroup>
|
||||
<thead><tr>
|
||||
<th>
|
||||
<p>
|
||||
Name
|
||||
</p>
|
||||
</th>
|
||||
<th>
|
||||
<p>
|
||||
POSIX-standard name
|
||||
</p>
|
||||
</th>
|
||||
<th>
|
||||
<p>
|
||||
Description
|
||||
</p>
|
||||
</th>
|
||||
</tr></thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
alnum
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
Yes
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
Any alpha-numeric character.
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
alpha
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
Yes
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
Any alphabetic character.
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
blank
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
Yes
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
Any whitespace character that is not a line separator.
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
cntrl
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
Yes
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
Any control character.
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
d
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
No
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
Any decimal digit
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
digit
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
Yes
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
Any decimal digit.
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
graph
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
Yes
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
Any graphical character.
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
l
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
No
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
Any lower case character.
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
lower
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
Yes
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
Any lower case character.
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
print
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
Yes
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
Any printable character.
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
punct
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
Yes
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
Any punctuation character.
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
s
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
No
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
Any whitespace character.
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
space
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
Yes
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
Any whitespace character.
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
unicode
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
No
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
Any extended character whose code point is above 255 in value.
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
u
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
No
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
Any upper case character.
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
upper
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
Yes
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
Any upper case character.
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
w
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
No
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
Any word character (alphanumeric characters plus the underscore).
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
word
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
No
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
Any word character (alphanumeric characters plus the underscore).
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
xdigit
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
Yes
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
Any hexadecimal digit character.
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table></div>
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 1998-2010 John Maddock<p>
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
|
||||
</p>
|
||||
</div></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="../character_classes.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../character_classes.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="optional_char_class_names.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -481,9 +481,7 @@
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
#
|
||||
</p>
|
||||
<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"></ol></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
@@ -399,9 +399,9 @@
|
||||
sets</a>
|
||||
</h5>
|
||||
<p>
|
||||
A character set is a bracket-expression starting with <code class="literal">[</code>
|
||||
and ending with <code class="literal"></code>], it defines a set of characters, and
|
||||
matches any single character that is a member of that set.
|
||||
A character set is a bracket-expression starting with <code class="literal">[] and ending
|
||||
with <code class="literal"></code></code>, it defines a set of characters, and matches
|
||||
any single character that is a member of that set.
|
||||
</p>
|
||||
<p>
|
||||
A bracket expression may contain any combination of the following:
|
||||
@@ -702,7 +702,7 @@
|
||||
</table></div>
|
||||
<h6>
|
||||
<a name="boost_regex.syntax.perl_syntax.h21"></a>
|
||||
<span class="phrase"><a name="boost_regex.syntax.perl_syntax._quot_single_character_quot__character_classes_"></a></span><a class="link" href="perl_syntax.html#boost_regex.syntax.perl_syntax._quot_single_character_quot__character_classes_">"Single
|
||||
<span class="phrase"><a name="boost_regex.syntax.perl_syntax.single_character_character_class"></a></span><a class="link" href="perl_syntax.html#boost_regex.syntax.perl_syntax.single_character_character_class">"Single
|
||||
character" character classes:</a>
|
||||
</h6>
|
||||
<p>
|
||||
@@ -1361,8 +1361,51 @@
|
||||
from elsewhere in the pattern.
|
||||
</li>
|
||||
</ul></div>
|
||||
<h5>
|
||||
<h6>
|
||||
<a name="boost_regex.syntax.perl_syntax.h42"></a>
|
||||
<span class="phrase"><a name="boost_regex.syntax.perl_syntax.backtracking_control_verbs"></a></span><a class="link" href="perl_syntax.html#boost_regex.syntax.perl_syntax.backtracking_control_verbs">Backtracking
|
||||
Control Verbs</a>
|
||||
</h6>
|
||||
<p>
|
||||
This library has partial support for Perl's backtracking control verbs, in
|
||||
particular (*MARK) is not supported. There may also be detail differences
|
||||
in behaviour between this library and Perl, not least because Perl's behaviour
|
||||
is rather under-documented and often somewhat random in how it behaves in
|
||||
practice. The verbs supported are:
|
||||
</p>
|
||||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
|
||||
<li class="listitem">
|
||||
<code class="literal">(*PRUNE)</code> Has no effect unless backtracked onto, in
|
||||
which case all the backtracking information prior to this point is discarded.
|
||||
</li>
|
||||
<li class="listitem">
|
||||
<code class="literal">(*SKIP)</code> Behaves the same as <code class="literal">(*PRUNE)</code>
|
||||
except that it is assumed that no match can possibly occur prior to the
|
||||
current point in the string being searched. This can be used to optimize
|
||||
searches by skipping over chunks of text that have already been determined
|
||||
can not form a match.
|
||||
</li>
|
||||
<li class="listitem">
|
||||
<code class="literal">(*THEN)</code> Has no effect unless backtracked onto, in
|
||||
which case all subsequent alternatives in a group of alternations are
|
||||
discarded.
|
||||
</li>
|
||||
<li class="listitem">
|
||||
<code class="literal">(*COMMIT)</code> Has no effect unless backtracked onto, in
|
||||
which case all subsequent matching/searching attempts are abandoned.
|
||||
</li>
|
||||
<li class="listitem">
|
||||
<code class="literal">(*FAIL)</code> Causes the match to fail unconditionally at
|
||||
this point, can be used to force the engine to backtrack.
|
||||
</li>
|
||||
<li class="listitem">
|
||||
<code class="literal">(*ACCEPT)</code> Causes the pattern to be considered matched
|
||||
at the current point. Any half-open sub-expressions are closed at the
|
||||
current point.
|
||||
</li>
|
||||
</ul></div>
|
||||
<h5>
|
||||
<a name="boost_regex.syntax.perl_syntax.h43"></a>
|
||||
<span class="phrase"><a name="boost_regex.syntax.perl_syntax.operator_precedence"></a></span><a class="link" href="perl_syntax.html#boost_regex.syntax.perl_syntax.operator_precedence">Operator
|
||||
precedence</a>
|
||||
</h5>
|
||||
@@ -1375,7 +1418,7 @@
|
||||
<span class="special">[::]</span> <span class="special">[..]</span></code>
|
||||
</li>
|
||||
<li class="listitem">
|
||||
Escaped characters [^]
|
||||
Escaped characters <code class="literal">\</code>
|
||||
</li>
|
||||
<li class="listitem">
|
||||
Character set (bracket expression) <code class="computeroutput"><span class="special">[]</span></code>
|
||||
@@ -1397,7 +1440,7 @@
|
||||
</li>
|
||||
</ol></div>
|
||||
<h4>
|
||||
<a name="boost_regex.syntax.perl_syntax.h43"></a>
|
||||
<a name="boost_regex.syntax.perl_syntax.h44"></a>
|
||||
<span class="phrase"><a name="boost_regex.syntax.perl_syntax.what_gets_matched"></a></span><a class="link" href="perl_syntax.html#boost_regex.syntax.perl_syntax.what_gets_matched">What
|
||||
gets matched</a>
|
||||
</h4>
|
||||
@@ -1573,7 +1616,7 @@
|
||||
</tbody>
|
||||
</table></div>
|
||||
<h4>
|
||||
<a name="boost_regex.syntax.perl_syntax.h44"></a>
|
||||
<a name="boost_regex.syntax.perl_syntax.h45"></a>
|
||||
<span class="phrase"><a name="boost_regex.syntax.perl_syntax.variations"></a></span><a class="link" href="perl_syntax.html#boost_regex.syntax.perl_syntax.variations">Variations</a>
|
||||
</h4>
|
||||
<p>
|
||||
@@ -1582,7 +1625,7 @@
|
||||
and <code class="literal">JScript</code></a> are all synonyms for <code class="literal">perl</code>.
|
||||
</p>
|
||||
<h4>
|
||||
<a name="boost_regex.syntax.perl_syntax.h45"></a>
|
||||
<a name="boost_regex.syntax.perl_syntax.h46"></a>
|
||||
<span class="phrase"><a name="boost_regex.syntax.perl_syntax.options"></a></span><a class="link" href="perl_syntax.html#boost_regex.syntax.perl_syntax.options">Options</a>
|
||||
</h4>
|
||||
<p>
|
||||
@@ -1594,7 +1637,7 @@
|
||||
are to be applied.
|
||||
</p>
|
||||
<h4>
|
||||
<a name="boost_regex.syntax.perl_syntax.h46"></a>
|
||||
<a name="boost_regex.syntax.perl_syntax.h47"></a>
|
||||
<span class="phrase"><a name="boost_regex.syntax.perl_syntax.pattern_modifiers"></a></span><a class="link" href="perl_syntax.html#boost_regex.syntax.perl_syntax.pattern_modifiers">Pattern
|
||||
Modifiers</a>
|
||||
</h4>
|
||||
@@ -1606,7 +1649,7 @@
|
||||
and <code class="literal">no_mod_s</code></a>.
|
||||
</p>
|
||||
<h4>
|
||||
<a name="boost_regex.syntax.perl_syntax.h47"></a>
|
||||
<a name="boost_regex.syntax.perl_syntax.h48"></a>
|
||||
<span class="phrase"><a name="boost_regex.syntax.perl_syntax.references"></a></span><a class="link" href="perl_syntax.html#boost_regex.syntax.perl_syntax.references">References</a>
|
||||
</h4>
|
||||
<p>
|
||||
|
||||
@@ -58,12 +58,12 @@
|
||||
</ul></div>
|
||||
<h5>
|
||||
<a name="boost_regex.unicode.h1"></a>
|
||||
<span class="phrase"><a name="boost_regex.unicode.use_a_unicode_aware_regular_expression_type_"></a></span><a class="link" href="unicode.html#boost_regex.unicode.use_a_unicode_aware_regular_expression_type_">Use
|
||||
<span class="phrase"><a name="boost_regex.unicode.use_a_unicode_aware_regular_expr"></a></span><a class="link" href="unicode.html#boost_regex.unicode.use_a_unicode_aware_regular_expr">Use
|
||||
a Unicode Aware Regular Expression Type.</a>
|
||||
</h5>
|
||||
<p>
|
||||
If you have the <a href="http://www.ibm.com/software/globalization/icu/" target="_top">ICU
|
||||
library</a>, then Boost.Regex can be <a class="link" href="install.html#boost_regex.install.building_with_unicode_and_icu_support">configured
|
||||
library</a>, then Boost.Regex can be <a class="link" href="install.html#boost_regex.install.building_with_unicode_and_icu_su">configured
|
||||
to make use of it</a>, and provide a distinct regular expression type (boost::u32regex),
|
||||
that supports both Unicode specific character properties, and the searching
|
||||
of text that is encoded in either UTF-8, UTF-16, or UTF-32. See: <a class="link" href="ref/non_std_strings/icu.html" title="Working With Unicode and ICU String Types">ICU
|
||||
|
||||
+24
-1
@@ -184,6 +184,29 @@
|
||||
and Further Information</a></span></dt>
|
||||
<dt><span class="section"><a href="boost_regex/background_information/faq.html">FAQ</a></span></dt>
|
||||
<dt><span class="section"><a href="boost_regex/background_information/performance.html">Performance</a></span></dt>
|
||||
<dd><dl>
|
||||
<dt><span class="section"><a href="boost_regex/background_information/performance/section_Testing_Perl_searches_platform_Windows_x64_compiler_Microsoft_Visual_C_version_14_0_.html">Testing
|
||||
Perl searches (platform = Windows x64, compiler = Microsoft Visual C++ version
|
||||
14.0)</a></span></dt>
|
||||
<dt><span class="section"><a href="boost_regex/background_information/performance/section_Testing_Perl_searches_platform_linux_compiler_GNU_C_version_5_1_0_.html">Testing
|
||||
Perl searches (platform = linux, compiler = GNU C++ version 5.1.0)</a></span></dt>
|
||||
<dt><span class="section"><a href="boost_regex/background_information/performance/section_Testing_leftmost_longest_searches_platform_Windows_x64_compiler_Microsoft_Visual_C_version_14_0_.html">Testing
|
||||
leftmost-longest searches (platform = Windows x64, compiler = Microsoft Visual
|
||||
C++ version 14.0)</a></span></dt>
|
||||
<dt><span class="section"><a href="boost_regex/background_information/performance/section_Testing_leftmost_longest_searches_platform_linux_compiler_GNU_C_version_5_1_0_.html">Testing
|
||||
leftmost-longest searches (platform = linux, compiler = GNU C++ version 5.1.0)</a></span></dt>
|
||||
<dt><span class="section"><a href="boost_regex/background_information/performance/section_Testing_simple_Perl_matches_platform_Windows_x64_compiler_Microsoft_Visual_C_version_14_0_.html">Testing
|
||||
simple Perl matches (platform = Windows x64, compiler = Microsoft Visual
|
||||
C++ version 14.0)</a></span></dt>
|
||||
<dt><span class="section"><a href="boost_regex/background_information/performance/section_Testing_simple_Perl_matches_platform_linux_compiler_GNU_C_version_5_1_0_.html">Testing
|
||||
simple Perl matches (platform = linux, compiler = GNU C++ version 5.1.0)</a></span></dt>
|
||||
<dt><span class="section"><a href="boost_regex/background_information/performance/section_Testing_simple_leftmost_longest_matches_platform_Windows_x64_compiler_Microsoft_Visual_C_version_14_0_.html">Testing
|
||||
simple leftmost-longest matches (platform = Windows x64, compiler = Microsoft
|
||||
Visual C++ version 14.0)</a></span></dt>
|
||||
<dt><span class="section"><a href="boost_regex/background_information/performance/section_Testing_simple_leftmost_longest_matches_platform_linux_compiler_GNU_C_version_5_1_0_.html">Testing
|
||||
simple leftmost-longest matches (platform = linux, compiler = GNU C++ version
|
||||
5.1.0)</a></span></dt>
|
||||
</dl></dd>
|
||||
<dt><span class="section"><a href="boost_regex/background_information/standards.html">Standards
|
||||
Conformance</a></span></dt>
|
||||
<dt><span class="section"><a href="boost_regex/background_information/redist.html">Redistributables</a></span></dt>
|
||||
@@ -198,7 +221,7 @@
|
||||
</p>
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"><p><small>Last revised: February 14, 2015 at 13:20:56 GMT</small></p></td>
|
||||
<td align="left"><p><small>Last revised: October 15, 2015 at 17:25:24 GMT</small></p></td>
|
||||
<td align="right"><div class="copyright-footer"></div></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ expressions in a Unicode aware environment.
|
||||
In order to use this header you will need the
|
||||
[@http://www.ibm.com/software/globalization/icu/ ICU library], and you will need
|
||||
to have built the Boost.Regex library with
|
||||
[link boost_regex.install.building_with_unicode_and_icu_support ICU support enabled].
|
||||
[link boost_regex.install.building_with_unicode_and_icu_su ICU support enabled].
|
||||
|
||||
The header will enable you to:
|
||||
|
||||
|
||||
+1
-1
@@ -178,7 +178,7 @@ Custom error messages are loaded as follows:
|
||||
[[204][REG_ECTYPE]["Invalid character class name" ]]
|
||||
[[205][REG_EESCAPE]["Trailing backslash" ]]
|
||||
[[206][REG_ESUBREG]["Invalid back reference" ]]
|
||||
[[207][REG_EBRACK]["Unmatched [ or [^" ]]
|
||||
[[207][REG_EBRACK]["Unmatched \[ or \[^" ]]
|
||||
[[208][REG_EPAREN]["Unmatched ( or \\(" ]]
|
||||
[[209][REG_EBRACE]["Unmatched \\{" ]]
|
||||
[[210][REG_BADBR]["Invalid content of \\{\\}" ]]
|
||||
|
||||
+1
-2
@@ -14,8 +14,7 @@ thread synchronisation), but not by much. The following pages compare
|
||||
Boost.Regex with various other regular expression libraries for the
|
||||
following compilers:
|
||||
|
||||
* [@../vc71-performance.html Visual Studio.Net 2003 (recursive Boost.Regex implementation)].
|
||||
* [@../gcc-performance.html Gcc 3.2 (cygwin) (non-recursive Boost.Regex implementation)].
|
||||
[performance_all_sections]
|
||||
|
||||
[endsect]
|
||||
|
||||
|
||||
+3
-1
@@ -1,6 +1,6 @@
|
||||
|
||||
[article Boost.Regex
|
||||
[quickbook 1.3]
|
||||
[quickbook 1.7]
|
||||
[copyright 1998-2013 John Maddock]
|
||||
[license
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
@@ -12,6 +12,8 @@
|
||||
[/last-revision $Date$]
|
||||
]
|
||||
|
||||
[import ../performance/doc/performance_tables.qbk]
|
||||
|
||||
[template super[x]'''<superscript>'''[x]'''</superscript>''']
|
||||
[template sub[x]'''<subscript>'''[x]'''</subscript>''']
|
||||
|
||||
|
||||
@@ -27,8 +27,8 @@ algorithm is defined as follows:
|
||||
class Allocator, class charT, class traits>
|
||||
bool regex_search(const basic_string<charT, ST, SA>& s,
|
||||
match_results<
|
||||
typename basic_string<charT, ST,SA>::const_iterator,
|
||||
Allocator>& m,
|
||||
typename basic_string<charT, ST,SA>::const_iterator,
|
||||
Allocator>& m,
|
||||
const basic_regex<charT, traits>& e,
|
||||
match_flag_type flags = match_default);
|
||||
|
||||
|
||||
+18
-1
@@ -564,12 +564,29 @@ executes /no-pattern/.
|
||||
* [^(?(DEFINE)never-exectuted-pattern)] Defines a block of code that is never executed and matches no characters:
|
||||
this is usually used to define one or more named sub-expressions which are referred to from elsewhere in the pattern.
|
||||
|
||||
[h5 Backtracking Control Verbs]
|
||||
|
||||
This library has partial support for Perl's backtracking control verbs, in particular (*MARK) is not supported.
|
||||
There may also be detail differences in behaviour between this library and Perl, not least because Perl's behaviour
|
||||
is rather under-documented and often somewhat random in how it behaves in practice. The verbs supported are:
|
||||
|
||||
* [^(*PRUNE)] Has no effect unless backtracked onto, in which case all the backtracking information prior to this
|
||||
point is discarded.
|
||||
* [^(*SKIP)] Behaves the same as [^(*PRUNE)] except that it is assumed that no match can possibly occur prior to
|
||||
the current point in the string being searched. This can be used to optimize searches by skipping over chunks of text
|
||||
that have already been determined can not form a match.
|
||||
* [^(*THEN)] Has no effect unless backtracked onto, in which case all subsequent alternatives in a group of alternations
|
||||
are discarded.
|
||||
* [^(*COMMIT)] Has no effect unless backtracked onto, in which case all subsequent matching/searching attempts are abandoned.
|
||||
* [^(*FAIL)] Causes the match to fail unconditionally at this point, can be used to force the engine to backtrack.
|
||||
* [^(*ACCEPT)] Causes the pattern to be considered matched at the current point. Any half-open sub-expressions are closed at the current point.
|
||||
|
||||
[h4 Operator precedence]
|
||||
|
||||
The order of precedence for of operators is as follows:
|
||||
|
||||
# Collation-related bracket symbols `[==] [::] [..]`
|
||||
# Escaped characters [^\]
|
||||
# Escaped characters [^\\]
|
||||
# Character set (bracket expression) `[]`
|
||||
# Grouping [^()]
|
||||
# Single-character-ERE duplication [^* + ? {m,n}]
|
||||
|
||||
+1
-1
@@ -30,7 +30,7 @@ characters, it is not possible to search UTF-8, or even UTF-16 on many platforms
|
||||
If you have the
|
||||
[@http://www.ibm.com/software/globalization/icu/ ICU library], then
|
||||
Boost.Regex can be
|
||||
[link boost_regex.install.building_with_unicode_and_icu_support
|
||||
[link boost_regex.install.building_with_unicode_and_icu_su
|
||||
configured to make use
|
||||
of it], and provide a distinct regular expression type (boost::u32regex),
|
||||
that supports both Unicode specific character properties, and the searching
|
||||
|
||||
@@ -1,703 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Regular Expression Performance Comparison</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
|
||||
<meta name="Template" content="C:\PROGRAM FILES\MICROSOFT OFFICE\OFFICE\html.dot">
|
||||
<meta name="GENERATOR" content="Microsoft FrontPage Express 2.0">
|
||||
</head>
|
||||
<body bgcolor="#ffffff" link="#0000ff" vlink="#800080">
|
||||
<h2>Regular Expression Performance Comparison</h2>
|
||||
<p>
|
||||
The following tables provide comparisons between the following regular
|
||||
expression libraries:</p>
|
||||
<p><a href="http://research.microsoft.com/projects/greta">GRETA</a>.</p>
|
||||
<p><a href="http://www.boost.org/">The Boost regex library</a>.</p>
|
||||
<p><a href="http://arglist.com/regex/">Henry Spencer's regular expression library</a>
|
||||
- this is provided for comparison as a typical non-backtracking implementation.</p>
|
||||
<P>Philip Hazel's <A href="http://www.pcre.org">PCRE</A> library.</P>
|
||||
<H3>Details</H3>
|
||||
<P>Machine: Intel Pentium 4 2.8GHz PC.</P>
|
||||
<P>Compiler: Microsoft Visual C++ version 7.1.</P>
|
||||
<P>C++ Standard Library: Dinkumware standard library version 313.</P>
|
||||
<P>OS: Win32.</P>
|
||||
<P>Boost version: 1.31.0.</P>
|
||||
<P>PCRE version: 3.9.</P>
|
||||
<P>
|
||||
As ever care should be taken in interpreting the results, only sensible regular
|
||||
expressions (rather than pathological cases) are given, most are taken from the
|
||||
Boost regex examples, or from the <a href="http://www.regxlib.com/">Library of
|
||||
Regular Expressions</a>. In addition, some variation in the relative
|
||||
performance of these libraries can be expected on other machines - as memory
|
||||
access and processor caching effects can be quite large for most finite state
|
||||
machine algorithms.</P>
|
||||
<H3>Averages</H3>
|
||||
<P>The following are the average relative scores for all the tests: the perfect
|
||||
regular expression library would score 1, in practice any small number
|
||||
(say less that 4 or 5) is pretty good.</P>
|
||||
<P><table border="1" cellspacing="1">
|
||||
<tr>
|
||||
<td><strong>GRETA</strong></td>
|
||||
<td><strong>GRETA<BR>
|
||||
(non-recursive mode)</strong></td>
|
||||
<td><strong>Boost</strong></td>
|
||||
<td><strong>Boost + C++ locale</strong></td>
|
||||
<td><strong>POSIX</strong></td>
|
||||
<td><strong>PCRE</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>2.31619</td>
|
||||
<td>6.14203</td>
|
||||
<td>2.30668</td>
|
||||
<td>1.94363</td>
|
||||
<td>124.752</td>
|
||||
<td>2.09365</td>
|
||||
</tr>
|
||||
</table>
|
||||
</P>
|
||||
<h3>Comparison 1: Long Search</h3>
|
||||
<p>For each of the following regular expressions the time taken to find all
|
||||
occurrences of the expression within a long English language text was measured
|
||||
(<a href="http://www.gutenberg.org/files/3200/old/mtent12.zip">mtent12.txt</a>
|
||||
from <a href="http://promo.net/pg/">Project Gutenberg</a>, 19Mb). </p>
|
||||
<P><table border="1" cellspacing="1">
|
||||
<tr>
|
||||
<td><strong>Expression</strong></td>
|
||||
<td><strong>GRETA</strong></td>
|
||||
<td><strong>GRETA<BR>
|
||||
(non-recursive mode)</strong></td>
|
||||
<td><strong>Boost</strong></td>
|
||||
<td><strong>Boost + C++ locale</strong></td>
|
||||
<td><strong>POSIX</strong></td>
|
||||
<td><strong>PCRE</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>Twain</code></td>
|
||||
<td><font color="#008000">1<BR>
|
||||
(0.0407s)</font></td>
|
||||
<td><font color="#008000">1<BR>
|
||||
(0.0407s)</font></td>
|
||||
<td>4.18<BR>
|
||||
(0.17s)</td>
|
||||
<td>4.18<BR>
|
||||
(0.17s)</td>
|
||||
<td>135<BR>
|
||||
(5.48s)</td>
|
||||
<td>1.37<BR>
|
||||
(0.0557s)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>Huck[[:alpha:]]+</code></td>
|
||||
<td><font color="#008000">1.02<BR>
|
||||
(0.0381s)</font></td>
|
||||
<td><font color="#008000">1<BR>
|
||||
(0.0375s)</font></td>
|
||||
<td>4.53<BR>
|
||||
(0.17s)</td>
|
||||
<td>4.54<BR>
|
||||
(0.17s)</td>
|
||||
<td>166<BR>
|
||||
(6.23s)</td>
|
||||
<td>1.34<BR>
|
||||
(0.0501s)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>[[:alpha:]]+ing</code></td>
|
||||
<td>4.3<BR>
|
||||
(4.18s)</td>
|
||||
<td>9.93<BR>
|
||||
(9.65s)</td>
|
||||
<td>1.15<BR>
|
||||
(1.12s)</td>
|
||||
<td><font color="#008000">1<BR>
|
||||
(0.972s)</font></td>
|
||||
<td>8.15<BR>
|
||||
(7.92s)</td>
|
||||
<td>5.85<BR>
|
||||
(5.69s)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>^[^ ]*?Twain</code></td>
|
||||
<td>6.25<BR>
|
||||
(1.84s)</td>
|
||||
<td>20.9<BR>
|
||||
(6.16s)</td>
|
||||
<td>1.56<BR>
|
||||
(0.461s)</td>
|
||||
<td><font color="#008000">1<BR>
|
||||
(0.295s)</font></td>
|
||||
<td>NA</td>
|
||||
<td>2.58<BR>
|
||||
(0.761s)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>Tom|Sawyer|Huckleberry|Finn</code></td>
|
||||
<td>6.53<BR>
|
||||
(0.711s)</td>
|
||||
<td>11.5<BR>
|
||||
(1.25s)</td>
|
||||
<td>2.3<BR>
|
||||
(0.251s)</td>
|
||||
<td><font color="#008000">1<BR>
|
||||
(0.109s)</font></td>
|
||||
<td>196<BR>
|
||||
(21.4s)</td>
|
||||
<td>1.77<BR>
|
||||
(0.193s)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>(Tom|Sawyer|Huckleberry|Finn).{0,30}river|river.{0,30}(Tom|Sawyer|Huckleberry|Finn)</code></td>
|
||||
<td>3.88<BR>
|
||||
(0.972s)</td>
|
||||
<td>6.48<BR>
|
||||
(1.62s)</td>
|
||||
<td>1.66<BR>
|
||||
(0.416s)</td>
|
||||
<td><font color="#008000">1<BR>
|
||||
(0.251s)</font></td>
|
||||
<td>NA</td>
|
||||
<td>2.48<BR>
|
||||
(0.62s)</td>
|
||||
</tr>
|
||||
</table>
|
||||
</P>
|
||||
<h3>Comparison 2: Medium Sized Search</h3>
|
||||
<p>For each of the following regular expressions the time taken to find all
|
||||
occurrences of the expression within a medium sized English language text was
|
||||
measured (the first 50K from mtent12.txt). </p>
|
||||
<P><table border="1" cellspacing="1">
|
||||
<tr>
|
||||
<td><strong>Expression</strong></td>
|
||||
<td><strong>GRETA</strong></td>
|
||||
<td><strong>GRETA<BR>
|
||||
(non-recursive mode)</strong></td>
|
||||
<td><strong>Boost</strong></td>
|
||||
<td><strong>Boost + C++ locale</strong></td>
|
||||
<td><strong>POSIX</strong></td>
|
||||
<td><strong>PCRE</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>Twain</code></td>
|
||||
<td><font color="#008000">1<BR>
|
||||
(9.05e-005s)</font></td>
|
||||
<td><font color="#008000">1.03<BR>
|
||||
(9.29e-005s)</font></td>
|
||||
<td>4.92<BR>
|
||||
(0.000445s)</td>
|
||||
<td>4.92<BR>
|
||||
(0.000445s)</td>
|
||||
<td>43.2<BR>
|
||||
(0.00391s)</td>
|
||||
<td>3.18<BR>
|
||||
(0.000288s)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>Huck[[:alpha:]]+</code></td>
|
||||
<td><font color="#008000">1<BR>
|
||||
(8.56e-005s)</font></td>
|
||||
<td><font color="#008000">1<BR>
|
||||
(8.56e-005s)</font></td>
|
||||
<td>4.97<BR>
|
||||
(0.000425s)</td>
|
||||
<td>4.98<BR>
|
||||
(0.000426s)</td>
|
||||
<td>2.8<BR>
|
||||
(0.000239s)</td>
|
||||
<td>2.2<BR>
|
||||
(0.000188s)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>[[:alpha:]]+ing</code></td>
|
||||
<td>5.29<BR>
|
||||
(0.011s)</td>
|
||||
<td>11.8<BR>
|
||||
(0.0244s)</td>
|
||||
<td>1.19<BR>
|
||||
(0.00246s)</td>
|
||||
<td><font color="#008000">1<BR>
|
||||
(0.00207s)</font></td>
|
||||
<td>8.77<BR>
|
||||
(0.0182s)</td>
|
||||
<td>6.88<BR>
|
||||
(0.0142s)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>^[^ ]*?Twain</code></td>
|
||||
<td>5.98<BR>
|
||||
(0.00462s)</td>
|
||||
<td>20.2<BR>
|
||||
(0.0156s)</td>
|
||||
<td>1.54<BR>
|
||||
(0.00119s)</td>
|
||||
<td><font color="#008000">1<BR>
|
||||
(0.000772s)</font></td>
|
||||
<td>NA</td>
|
||||
<td>2.53<BR>
|
||||
(0.00195s)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>Tom|Sawyer|Huckleberry|Finn</code></td>
|
||||
<td>3.42<BR>
|
||||
(0.00207s)</td>
|
||||
<td>6.31<BR>
|
||||
(0.00383s)</td>
|
||||
<td>1.71<BR>
|
||||
(0.00104s)</td>
|
||||
<td><font color="#008000">1<BR>
|
||||
(0.000606s)</font></td>
|
||||
<td>81.5<BR>
|
||||
(0.0494s)</td>
|
||||
<td>1.96<BR>
|
||||
(0.00119s)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>(Tom|Sawyer|Huckleberry|Finn).{0,30}river|river.{0,30}(Tom|Sawyer|Huckleberry|Finn)</code></td>
|
||||
<td>1.97<BR>
|
||||
(0.00266s)</td>
|
||||
<td>3.77<BR>
|
||||
(0.00509s)</td>
|
||||
<td>1.38<BR>
|
||||
(0.00186s)</td>
|
||||
<td><font color="#008000">1<BR>
|
||||
(0.00135s)</font></td>
|
||||
<td>297<BR>
|
||||
(0.401s)</td>
|
||||
<td>1.77<BR>
|
||||
(0.00238s)</td>
|
||||
</tr>
|
||||
</table>
|
||||
</P>
|
||||
<H3>Comparison 3: C++ Code Search</H3>
|
||||
<P>For each of the following regular expressions the time taken to find all
|
||||
occurrences of the expression within the C++ source file <A href="../../../boost/crc.hpp">
|
||||
boost/crc.hpp</A> was measured. </P>
|
||||
<P><table border="1" cellspacing="1">
|
||||
<tr>
|
||||
<td><strong>Expression</strong></td>
|
||||
<td><strong>GRETA</strong></td>
|
||||
<td><strong>GRETA<BR>
|
||||
(non-recursive mode)</strong></td>
|
||||
<td><strong>Boost</strong></td>
|
||||
<td><strong>Boost + C++ locale</strong></td>
|
||||
<td><strong>POSIX</strong></td>
|
||||
<td><strong>PCRE</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>^(template[[:space:]]*<[^;:{]+>[[:space:]]*)?(class|struct)[[:space:]]*(\<\w+\>([
|
||||
]*\([^)]*\))?[[:space:]]*)*(\<\w*\>)[[:space:]]*(<[^;:{]+>[[:space:]]*)?(\{|:[^;\{()]*\{)</code></td>
|
||||
<td>6.67<BR>
|
||||
(0.00147s)</td>
|
||||
<td>36.9<BR>
|
||||
(0.00813s)</td>
|
||||
<td><font color="#008000">1.03<BR>
|
||||
(0.000227s)</font></td>
|
||||
<td><font color="#008000">1<BR>
|
||||
(0.00022s)</font></td>
|
||||
<td>557<BR>
|
||||
(0.123s)</td>
|
||||
<td>2.57<BR>
|
||||
(0.000566s)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>(^[
|
||||
]*#(?:[^\\\n]|\\[^\n_[:punct:][:alnum:]]*[\n[:punct:][:word:]])*)|(//[^\n]*|/\*.*?\*/)|\<([+-]?(?:(?:0x[[:xdigit:]]+)|(?:(?:[[:digit:]]*\.)?[[:digit:]]+(?:[eE][+-]?[[:digit:]]+)?))u?(?:(?:int(?:8|16|32|64))|L)?)\>|('(?:[^\\']|\\.)*'|"(?:[^\\"]|\\.)*")|\<(__asm|__cdecl|__declspec|__export|__far16|__fastcall|__fortran|__import|__pascal|__rtti|__stdcall|_asm|_cdecl|__except|_export|_far16|_fastcall|__finally|_fortran|_import|_pascal|_stdcall|__thread|__try|asm|auto|bool|break|case|catch|cdecl|char|class|const|const_cast|continue|default|delete|do|double|dynamic_cast|else|enum|explicit|extern|false|float|for|friend|goto|if|inline|int|long|mutable|namespace|new|operator|pascal|private|protected|public|register|reinterpret_cast|return|short|signed|sizeof|static|static_cast|struct|switch|template|this|throw|true|try|typedef|typeid|typename|union|unsigned|using|virtual|void|volatile|wchar_t|while)\></code></td>
|
||||
<td><font color="#008000">1<BR>
|
||||
(0.00555s)</font></td>
|
||||
<td>3.32<BR>
|
||||
(0.0185s)</td>
|
||||
<td>2.53<BR>
|
||||
(0.0141s)</td>
|
||||
<td>1.94<BR>
|
||||
(0.0108s)</td>
|
||||
<td>NA</td>
|
||||
<td>3.38<BR>
|
||||
(0.0188s)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>^[ ]*#[ ]*include[ ]+("[^"]+"|<[^>]+>)</code></td>
|
||||
<td>4.77<BR>
|
||||
(0.00156s)</td>
|
||||
<td>24.8<BR>
|
||||
(0.00814s)</td>
|
||||
<td>1.13<BR>
|
||||
(0.000372s)</td>
|
||||
<td><font color="#008000">1<BR>
|
||||
(0.000328s)</font></td>
|
||||
<td>120<BR>
|
||||
(0.0394s)</td>
|
||||
<td>1.58<BR>
|
||||
(0.000518s)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>^[ ]*#[ ]*include[ ]+("boost/[^"]+"|<boost/[^>]+>)</code></td>
|
||||
<td>4.72<BR>
|
||||
(0.00154s)</td>
|
||||
<td>24.8<BR>
|
||||
(0.00813s)</td>
|
||||
<td>1.12<BR>
|
||||
(0.000367s)</td>
|
||||
<td><font color="#008000">1<BR>
|
||||
(0.000328s)</font></td>
|
||||
<td>143<BR>
|
||||
(0.0469s)</td>
|
||||
<td>1.58<BR>
|
||||
(0.000518s)</td>
|
||||
</tr>
|
||||
</table>
|
||||
</P>
|
||||
<H3>
|
||||
<H3>Comparison 4: HTML Document Search</H3>
|
||||
</H3>
|
||||
<P>For each of the following regular expressions the time taken to find all
|
||||
occurrences of the expression within the html file <A href="../../libraries.htm">libs/libraries.htm</A>
|
||||
was measured. </P>
|
||||
<P><table border="1" cellspacing="1">
|
||||
<tr>
|
||||
<td><strong>Expression</strong></td>
|
||||
<td><strong>GRETA</strong></td>
|
||||
<td><strong>GRETA<BR>
|
||||
(non-recursive mode)</strong></td>
|
||||
<td><strong>Boost</strong></td>
|
||||
<td><strong>Boost + C++ locale</strong></td>
|
||||
<td><strong>POSIX</strong></td>
|
||||
<td><strong>PCRE</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>beman|john|dave</code></td>
|
||||
<td>4.07<BR>
|
||||
(0.00111s)</td>
|
||||
<td>7.14<BR>
|
||||
(0.00195s)</td>
|
||||
<td>1.75<BR>
|
||||
(0.000479s)</td>
|
||||
<td><font color="#008000">1<BR>
|
||||
(0.000273s)</font></td>
|
||||
<td>54.3<BR>
|
||||
(0.0149s)</td>
|
||||
<td>1.83<BR>
|
||||
(0.000499s)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code><p>.*?</p></code></td>
|
||||
<td><font color="#008000">1<BR>
|
||||
(6.59e-005s)</font></td>
|
||||
<td><font color="#008000">1.04<BR>
|
||||
(6.84e-005s)</font></td>
|
||||
<td>4.15<BR>
|
||||
(0.000273s)</td>
|
||||
<td>4.23<BR>
|
||||
(0.000279s)</td>
|
||||
<td>NA</td>
|
||||
<td>4.23<BR>
|
||||
(0.000279s)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code><a[^>]+href=("[^"]*"|[^[:space:]]+)[^>]*></code></td>
|
||||
<td>1.39<BR>
|
||||
(0.000626s)</td>
|
||||
<td>1.83<BR>
|
||||
(0.000821s)</td>
|
||||
<td>1.41<BR>
|
||||
(0.000636s)</td>
|
||||
<td><font color="#008000">1<BR>
|
||||
(0.00045s)</font></td>
|
||||
<td>351<BR>
|
||||
(0.158s)</td>
|
||||
<td>1.13<BR>
|
||||
(0.000509s)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code><h[12345678][^>]*>.*?</h[12345678]></code></td>
|
||||
<td><font color="#008000">1<BR>
|
||||
(0.000142s)</font></td>
|
||||
<td>1.21<BR>
|
||||
(0.000171s)</td>
|
||||
<td>2.62<BR>
|
||||
(0.000372s)</td>
|
||||
<td>1.48<BR>
|
||||
(0.00021s)</td>
|
||||
<td>NA</td>
|
||||
<td>1.73<BR>
|
||||
(0.000245s)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code><img[^>]+src=("[^"]*"|[^[:space:]]+)[^>]*></code></td>
|
||||
<td><font color="#008000">1<BR>
|
||||
(5.38e-005s)</font></td>
|
||||
<td><font color="#008000">1.05<BR>
|
||||
(5.63e-005s)</font></td>
|
||||
<td>5<BR>
|
||||
(0.000269s)</td>
|
||||
<td>5.18<BR>
|
||||
(0.000278s)</td>
|
||||
<td>604<BR>
|
||||
(0.0325s)</td>
|
||||
<td>4.05<BR>
|
||||
(0.000218s)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code><font[^>]+face=("[^"]*"|[^[:space:]]+)[^>]*>.*?</font></code></td>
|
||||
<td><font color="#008000">1<BR>
|
||||
(6.05e-005s)</font></td>
|
||||
<td><font color="#008000">1.09<BR>
|
||||
(6.59e-005s)</font></td>
|
||||
<td>4.45<BR>
|
||||
(0.000269s)</td>
|
||||
<td>4.69<BR>
|
||||
(0.000284s)</td>
|
||||
<td>NA</td>
|
||||
<td>3.64<BR>
|
||||
(0.00022s)</td>
|
||||
</tr>
|
||||
</table>
|
||||
</P>
|
||||
<H3>Comparison 3: Simple Matches</H3>
|
||||
<p>
|
||||
For each of the following regular expressions the time taken to match against
|
||||
the text indicated was measured. </p>
|
||||
<P><table border="1" cellspacing="1">
|
||||
<tr>
|
||||
<td><strong>Expression</strong></td>
|
||||
<td><strong>Text</strong></td>
|
||||
<td><strong>GRETA</strong></td>
|
||||
<td><strong>GRETA<BR>
|
||||
(non-recursive mode)</strong></td>
|
||||
<td><strong>Boost</strong></td>
|
||||
<td><strong>Boost + C++ locale</strong></td>
|
||||
<td><strong>POSIX</strong></td>
|
||||
<td><strong>PCRE</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>abc</code></td>
|
||||
<td>abc</td>
|
||||
<td>1.32<BR>
|
||||
(2.24e-007s)</td>
|
||||
<td>1.86<BR>
|
||||
(3.15e-007s)</td>
|
||||
<td>1.25<BR>
|
||||
(2.12e-007s)</td>
|
||||
<td>1.24<BR>
|
||||
(2.1e-007s)</td>
|
||||
<td>2.98<BR>
|
||||
(5.05e-007s)</td>
|
||||
<td><font color="#008000">1<BR>
|
||||
(1.7e-007s)</font></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>^([0-9]+)(\-| |$)(.*)$</code></td>
|
||||
<td>100- this is a line of ftp response which contains a message string</td>
|
||||
<td>1.32<BR>
|
||||
(5.91e-007s)</td>
|
||||
<td>1.96<BR>
|
||||
(8.78e-007s)</td>
|
||||
<td>2.68<BR>
|
||||
(1.2e-006s)</td>
|
||||
<td>1.53<BR>
|
||||
(6.88e-007s)</td>
|
||||
<td>332<BR>
|
||||
(0.000149s)</td>
|
||||
<td><font color="#008000">1<BR>
|
||||
(4.49e-007s)</font></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>([[:digit:]]{4}[- ]){3}[[:digit:]]{3,4}</code></td>
|
||||
<td>1234-5678-1234-456</td>
|
||||
<td>1.44<BR>
|
||||
(7.16e-007s)</td>
|
||||
<td>2.04<BR>
|
||||
(1.01e-006s)</td>
|
||||
<td>3.35<BR>
|
||||
(1.66e-006s)</td>
|
||||
<td>2.15<BR>
|
||||
(1.07e-006s)</td>
|
||||
<td>31.4<BR>
|
||||
(1.56e-005s)</td>
|
||||
<td><font color="#008000">1<BR>
|
||||
(4.96e-007s)</font></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$</code></td>
|
||||
<td>john@johnmaddock.co.uk</td>
|
||||
<td><font color="#008000">1<BR>
|
||||
(1.18e-006s)</font></td>
|
||||
<td>1.42<BR>
|
||||
(1.68e-006s)</td>
|
||||
<td>2.06<BR>
|
||||
(2.44e-006s)</td>
|
||||
<td>1.35<BR>
|
||||
(1.6e-006s)</td>
|
||||
<td>165<BR>
|
||||
(0.000196s)</td>
|
||||
<td><font color="#008000">1.06<BR>
|
||||
(1.26e-006s)</font></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$</code></td>
|
||||
<td>foo12@foo.edu</td>
|
||||
<td><font color="#008000">1<BR>
|
||||
(1.09e-006s)</font></td>
|
||||
<td>1.44<BR>
|
||||
(1.57e-006s)</td>
|
||||
<td>2.21<BR>
|
||||
(2.4e-006s)</td>
|
||||
<td>1.41<BR>
|
||||
(1.53e-006s)</td>
|
||||
<td>108<BR>
|
||||
(0.000117s)</td>
|
||||
<td><font color="#008000">1.04<BR>
|
||||
(1.13e-006s)</font></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$</code></td>
|
||||
<td>bob.smith@foo.tv</td>
|
||||
<td><font color="#008000">1<BR>
|
||||
(1.07e-006s)</font></td>
|
||||
<td>1.43<BR>
|
||||
(1.53e-006s)</td>
|
||||
<td>2.21<BR>
|
||||
(2.37e-006s)</td>
|
||||
<td>1.45<BR>
|
||||
(1.55e-006s)</td>
|
||||
<td>123<BR>
|
||||
(0.000132s)</td>
|
||||
<td><font color="#008000">1.05<BR>
|
||||
(1.13e-006s)</font></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>^[a-zA-Z]{1,2}[0-9][0-9A-Za-z]{0,1} {0,1}[0-9][A-Za-z]{2}$</code></td>
|
||||
<td>EH10 2QQ</td>
|
||||
<td><font color="#008000">1<BR>
|
||||
(3.19e-007s)</font></td>
|
||||
<td>1.67<BR>
|
||||
(5.34e-007s)</td>
|
||||
<td>1.58<BR>
|
||||
(5.05e-007s)</td>
|
||||
<td>1.4<BR>
|
||||
(4.49e-007s)</td>
|
||||
<td>10.4<BR>
|
||||
(3.32e-006s)</td>
|
||||
<td>1.15<BR>
|
||||
(3.68e-007s)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>^[a-zA-Z]{1,2}[0-9][0-9A-Za-z]{0,1} {0,1}[0-9][A-Za-z]{2}$</code></td>
|
||||
<td>G1 1AA</td>
|
||||
<td><font color="#008000">1<BR>
|
||||
(3.29e-007s)</font></td>
|
||||
<td>1.65<BR>
|
||||
(5.44e-007s)</td>
|
||||
<td>1.51<BR>
|
||||
(4.96e-007s)</td>
|
||||
<td>1.36<BR>
|
||||
(4.49e-007s)</td>
|
||||
<td>8.46<BR>
|
||||
(2.79e-006s)</td>
|
||||
<td>1.1<BR>
|
||||
(3.63e-007s)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>^[a-zA-Z]{1,2}[0-9][0-9A-Za-z]{0,1} {0,1}[0-9][A-Za-z]{2}$</code></td>
|
||||
<td>SW1 1ZZ</td>
|
||||
<td><font color="#008000">1<BR>
|
||||
(3.25e-007s)</font></td>
|
||||
<td>1.64<BR>
|
||||
(5.34e-007s)</td>
|
||||
<td>1.56<BR>
|
||||
(5.05e-007s)</td>
|
||||
<td>1.38<BR>
|
||||
(4.49e-007s)</td>
|
||||
<td>9.29<BR>
|
||||
(3.02e-006s)</td>
|
||||
<td>1.13<BR>
|
||||
(3.68e-007s)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>^[[:digit:]]{1,2}/[[:digit:]]{1,2}/[[:digit:]]{4}$</code></td>
|
||||
<td>4/1/2001</td>
|
||||
<td><font color="#008000">1<BR>
|
||||
(3.44e-007s)</font></td>
|
||||
<td>1.55<BR>
|
||||
(5.34e-007s)</td>
|
||||
<td>2.36<BR>
|
||||
(8.12e-007s)</td>
|
||||
<td>2.2<BR>
|
||||
(7.55e-007s)</td>
|
||||
<td>19.6<BR>
|
||||
(6.72e-006s)</td>
|
||||
<td>1.81<BR>
|
||||
(6.21e-007s)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>^[[:digit:]]{1,2}/[[:digit:]]{1,2}/[[:digit:]]{4}$</code></td>
|
||||
<td>12/12/2001</td>
|
||||
<td><font color="#008000">1.05<BR>
|
||||
(6.59e-007s)</font></td>
|
||||
<td>1.66<BR>
|
||||
(1.05e-006s)</td>
|
||||
<td>1.44<BR>
|
||||
(9.07e-007s)</td>
|
||||
<td>1.23<BR>
|
||||
(7.73e-007s)</td>
|
||||
<td>11.6<BR>
|
||||
(7.34e-006s)</td>
|
||||
<td><font color="#008000">1<BR>
|
||||
(6.3e-007s)</font></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>^[-+]?[[:digit:]]*\.?[[:digit:]]*$</code></td>
|
||||
<td>123</td>
|
||||
<td><font color="#008000">1<BR>
|
||||
(5.72e-007s)</font></td>
|
||||
<td>1.59<BR>
|
||||
(9.07e-007s)</td>
|
||||
<td>1.6<BR>
|
||||
(9.16e-007s)</td>
|
||||
<td>1.49<BR>
|
||||
(8.5e-007s)</td>
|
||||
<td>6.14<BR>
|
||||
(3.51e-006s)</td>
|
||||
<td>1.22<BR>
|
||||
(6.97e-007s)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>^[-+]?[[:digit:]]*\.?[[:digit:]]*$</code></td>
|
||||
<td>+3.14159</td>
|
||||
<td><font color="#008000">1<BR>
|
||||
(6.78e-007s)</font></td>
|
||||
<td>1.52<BR>
|
||||
(1.03e-006s)</td>
|
||||
<td>1.47<BR>
|
||||
(9.94e-007s)</td>
|
||||
<td>1.31<BR>
|
||||
(8.88e-007s)</td>
|
||||
<td>10.8<BR>
|
||||
(7.34e-006s)</td>
|
||||
<td><font color="#008000">1.08<BR>
|
||||
(7.35e-007s)</font></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>^[-+]?[[:digit:]]*\.?[[:digit:]]*$</code></td>
|
||||
<td>-3.14159</td>
|
||||
<td><font color="#008000">1<BR>
|
||||
(6.78e-007s)</font></td>
|
||||
<td>1.52<BR>
|
||||
(1.03e-006s)</td>
|
||||
<td>1.46<BR>
|
||||
(9.92e-007s)</td>
|
||||
<td>1.32<BR>
|
||||
(8.98e-007s)</td>
|
||||
<td>10.5<BR>
|
||||
(7.11e-006s)</td>
|
||||
<td>1.11<BR>
|
||||
(7.54e-007s)</td>
|
||||
</tr>
|
||||
</table>
|
||||
</P>
|
||||
<hr>
|
||||
<p><i>© Copyright John Maddock 2003</i></p>
|
||||
<P><I>Use, modification and distribution are subject to the Boost Software License,
|
||||
Version 1.0. (See accompanying file <A href="../../../LICENSE_1_0.txt">LICENSE_1_0.txt</A>
|
||||
or copy at <A href="http://www.boost.org/LICENSE_1_0.txt">http://www.boost.org/LICENSE_1_0.txt</A>)</I></P>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#if defined(__BORLANDC__)
|
||||
# include <boost/regex/config/borland.hpp>
|
||||
#endif
|
||||
#include <boost/version.hpp>
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
@@ -41,6 +42,7 @@
|
||||
# include BOOST_REGEX_USER_CONFIG
|
||||
|
||||
# include <boost/config.hpp>
|
||||
# include <boost/predef.h>
|
||||
|
||||
#else
|
||||
/*
|
||||
@@ -69,6 +71,13 @@
|
||||
#define UNICODE
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Define a macro for the namespace that details are placed in, this includes the Boost
|
||||
* version number to avoid mismatched header and library versions:
|
||||
*/
|
||||
#define BOOST_REGEX_DETAIL_NS BOOST_JOIN(re_detail_, BOOST_VERSION)
|
||||
|
||||
/*
|
||||
* Fix for gcc prior to 3.4: std::ctype<wchar_t> doesn't allow
|
||||
* masks to be combined, for example:
|
||||
@@ -92,7 +101,13 @@
|
||||
#if defined(_MSC_VER) && !defined(_MSC_EXTENSIONS)
|
||||
# define BOOST_REGEX_NO_EXTERNAL_TEMPLATES
|
||||
#endif
|
||||
/*
|
||||
/*
|
||||
* Oracle compiler in C++11 mode doesn't like external templates for some reason:
|
||||
*/
|
||||
#ifdef __SUNPRO_CC
|
||||
# define BOOST_REGEX_NO_EXTERNAL_TEMPLATES
|
||||
#endif
|
||||
/*
|
||||
* Shared regex lib will crash without this, frankly it looks a lot like a gcc bug:
|
||||
*/
|
||||
#if defined(__MINGW32__)
|
||||
@@ -133,8 +148,14 @@
|
||||
|
||||
/* disable our own file-iterators and mapfiles if we can't
|
||||
* support them: */
|
||||
#if !defined(BOOST_HAS_DIRENT_H) && !(defined(_WIN32) && !defined(BOOST_REGEX_NO_W32))
|
||||
# define BOOST_REGEX_NO_FILEITER
|
||||
#if defined(_WIN32)
|
||||
# if defined(BOOST_REGEX_NO_W32) || BOOST_PLAT_WINDOWS_STORE
|
||||
# define BOOST_REGEX_NO_FILEITER
|
||||
# endif
|
||||
#else // defined(_WIN32)
|
||||
# if !defined(BOOST_HAS_DIRENT_H)
|
||||
# define BOOST_REGEX_NO_FILEITER
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* backwards compatibitity: */
|
||||
@@ -163,10 +184,20 @@
|
||||
* with MSVC and the /Zc:wchar_t option we place some extra unsigned short versions
|
||||
* of the non-inline functions in the library, so that users can still link to the lib,
|
||||
* irrespective of whether their own code is built with /Zc:wchar_t.
|
||||
* Note that this does NOT WORK with VC10 when the C++ locale is in effect as
|
||||
* Note that this does NOT WORK with VC10 and VC14 when the C++ locale is in effect as
|
||||
* the locale's <unsigned short> facets simply do not compile in that case.
|
||||
* As we default to the C++ locale when compiling for the windows runtime we
|
||||
* skip in this case aswell.
|
||||
*/
|
||||
#if defined(__cplusplus) && (defined(BOOST_MSVC) || defined(__ICL)) && !defined(BOOST_NO_INTRINSIC_WCHAR_T) && defined(BOOST_WINDOWS) && !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION) && !defined(BOOST_RWSTD_VER) && ((_MSC_VER < 1600) || !defined(BOOST_REGEX_USE_CPP_LOCALE))
|
||||
#if defined(__cplusplus) && \
|
||||
(defined(BOOST_MSVC) || defined(__ICL)) && \
|
||||
!defined(BOOST_NO_INTRINSIC_WCHAR_T) && \
|
||||
defined(BOOST_WINDOWS) && \
|
||||
!defined(__SGI_STL_PORT) && \
|
||||
!defined(_STLPORT_VERSION) && \
|
||||
!defined(BOOST_RWSTD_VER) && \
|
||||
((_MSC_VER < 1600) || !defined(BOOST_REGEX_USE_CPP_LOCALE)) && \
|
||||
!BOOST_PLAT_WINDOWS_RUNTIME
|
||||
# define BOOST_REGEX_HAS_OTHER_WCHAR_T
|
||||
# ifdef BOOST_MSVC
|
||||
# pragma warning(push)
|
||||
@@ -264,8 +295,19 @@
|
||||
# define BOOST_REGEX_USE_C_LOCALE
|
||||
#endif
|
||||
|
||||
/* use C++ locale when targeting windows store */
|
||||
#if BOOST_PLAT_WINDOWS_RUNTIME
|
||||
# define BOOST_REGEX_USE_CPP_LOCALE
|
||||
# define BOOST_REGEX_NO_WIN32_LOCALE
|
||||
#endif
|
||||
|
||||
/* Win32 defaults to native Win32 locale: */
|
||||
#if defined(_WIN32) && !defined(BOOST_REGEX_USE_WIN32_LOCALE) && !defined(BOOST_REGEX_USE_C_LOCALE) && !defined(BOOST_REGEX_USE_CPP_LOCALE) && !defined(BOOST_REGEX_NO_W32)
|
||||
#if defined(_WIN32) && \
|
||||
!defined(BOOST_REGEX_USE_WIN32_LOCALE) && \
|
||||
!defined(BOOST_REGEX_USE_C_LOCALE) && \
|
||||
!defined(BOOST_REGEX_USE_CPP_LOCALE) && \
|
||||
!defined(BOOST_REGEX_NO_W32) && \
|
||||
!defined(BOOST_REGEX_NO_WIN32_LOCALE)
|
||||
# define BOOST_REGEX_USE_WIN32_LOCALE
|
||||
#endif
|
||||
/* otherwise use C++ locale if supported: */
|
||||
@@ -334,7 +376,7 @@ if(0 == (x))\
|
||||
#if defined(__cplusplus) && defined(BOOST_REGEX_HAS_MS_STACK_GUARD)
|
||||
|
||||
namespace boost{
|
||||
namespace re_detail{
|
||||
namespace BOOST_REGEX_DETAIL_NS{
|
||||
|
||||
BOOST_REGEX_DECL void BOOST_REGEX_CALL reset_stack_guard_page();
|
||||
|
||||
@@ -387,7 +429,7 @@ BOOST_REGEX_DECL void BOOST_REGEX_CALL reset_stack_guard_page();
|
||||
****************************************************************************/
|
||||
|
||||
#if defined(__cplusplus) && defined(BOOST_REGEX_NON_RECURSIVE)
|
||||
namespace boost{ namespace re_detail{
|
||||
namespace boost{ namespace BOOST_REGEX_DETAIL_NS{
|
||||
|
||||
BOOST_REGEX_DECL void* BOOST_REGEX_CALL get_mem_block();
|
||||
BOOST_REGEX_DECL void BOOST_REGEX_CALL put_mem_block(void*);
|
||||
|
||||
+83
-83
@@ -34,7 +34,7 @@
|
||||
|
||||
namespace boost{
|
||||
|
||||
namespace re_detail{
|
||||
namespace BOOST_REGEX_DETAIL_NS{
|
||||
|
||||
//
|
||||
// Implementation details:
|
||||
@@ -108,18 +108,18 @@ public:
|
||||
struct boost_extensions_tag{};
|
||||
|
||||
icu_regex_traits()
|
||||
: m_pimpl(re_detail::get_icu_regex_traits_implementation(U_NAMESPACE_QUALIFIER Locale()))
|
||||
: m_pimpl(BOOST_REGEX_DETAIL_NS::get_icu_regex_traits_implementation(U_NAMESPACE_QUALIFIER Locale()))
|
||||
{
|
||||
}
|
||||
static size_type length(const char_type* p);
|
||||
|
||||
::boost::regex_constants::syntax_type syntax_type(char_type c)const
|
||||
{
|
||||
return ((c < 0x7f) && (c > 0)) ? re_detail::get_default_syntax_type(static_cast<char>(c)) : regex_constants::syntax_char;
|
||||
return ((c < 0x7f) && (c > 0)) ? BOOST_REGEX_DETAIL_NS::get_default_syntax_type(static_cast<char>(c)) : regex_constants::syntax_char;
|
||||
}
|
||||
::boost::regex_constants::escape_syntax_type escape_syntax_type(char_type c) const
|
||||
{
|
||||
return ((c < 0x7f) && (c > 0)) ? re_detail::get_default_escape_syntax_type(static_cast<char>(c)) : regex_constants::syntax_char;
|
||||
return ((c < 0x7f) && (c > 0)) ? BOOST_REGEX_DETAIL_NS::get_default_escape_syntax_type(static_cast<char>(c)) : regex_constants::syntax_char;
|
||||
}
|
||||
char_type translate(char_type c) const
|
||||
{
|
||||
@@ -154,7 +154,7 @@ public:
|
||||
bool isctype(char_type c, char_class_type f) const;
|
||||
int toi(const char_type*& p1, const char_type* p2, int radix)const
|
||||
{
|
||||
return re_detail::global_toi(p1, p2, radix, *this);
|
||||
return BOOST_REGEX_DETAIL_NS::global_toi(p1, p2, radix, *this);
|
||||
}
|
||||
int value(char_type c, int radix)const
|
||||
{
|
||||
@@ -163,7 +163,7 @@ public:
|
||||
locale_type imbue(locale_type l)
|
||||
{
|
||||
locale_type result(m_pimpl->getloc());
|
||||
m_pimpl = re_detail::get_icu_regex_traits_implementation(l);
|
||||
m_pimpl = BOOST_REGEX_DETAIL_NS::get_icu_regex_traits_implementation(l);
|
||||
return result;
|
||||
}
|
||||
locale_type getloc()const
|
||||
@@ -172,7 +172,7 @@ public:
|
||||
}
|
||||
std::string error_string(::boost::regex_constants::error_type n) const
|
||||
{
|
||||
return re_detail::get_default_error_string(n);
|
||||
return BOOST_REGEX_DETAIL_NS::get_default_error_string(n);
|
||||
}
|
||||
private:
|
||||
icu_regex_traits(const icu_regex_traits&);
|
||||
@@ -208,7 +208,7 @@ private:
|
||||
|
||||
static char_class_type lookup_icu_mask(const ::UChar32* p1, const ::UChar32* p2);
|
||||
|
||||
boost::shared_ptr< ::boost::re_detail::icu_regex_traits_implementation> m_pimpl;
|
||||
boost::shared_ptr< ::boost::BOOST_REGEX_DETAIL_NS::icu_regex_traits_implementation> m_pimpl;
|
||||
};
|
||||
|
||||
} // namespace boost
|
||||
@@ -241,7 +241,7 @@ typedef match_results<const ::UChar*> u16match;
|
||||
//
|
||||
// Construction of 32-bit regex types from UTF-8 and UTF-16 primitives:
|
||||
//
|
||||
namespace re_detail{
|
||||
namespace BOOST_REGEX_DETAIL_NS{
|
||||
|
||||
#if !defined(BOOST_NO_MEMBER_TEMPLATES) && !defined(__IBMCPP__)
|
||||
template <class InputIterator>
|
||||
@@ -341,18 +341,18 @@ inline u32regex make_u32regex(InputIterator i,
|
||||
InputIterator j,
|
||||
boost::regex_constants::syntax_option_type opt)
|
||||
{
|
||||
return re_detail::do_make_u32regex(i, j, opt, static_cast<boost::mpl::int_<sizeof(*i)> const*>(0));
|
||||
return BOOST_REGEX_DETAIL_NS::do_make_u32regex(i, j, opt, static_cast<boost::mpl::int_<sizeof(*i)> const*>(0));
|
||||
}
|
||||
//
|
||||
// construction from UTF-8 nul-terminated strings:
|
||||
//
|
||||
inline u32regex make_u32regex(const char* p, boost::regex_constants::syntax_option_type opt = boost::regex_constants::perl)
|
||||
{
|
||||
return re_detail::do_make_u32regex(p, p + std::strlen(p), opt, static_cast<boost::mpl::int_<1> const*>(0));
|
||||
return BOOST_REGEX_DETAIL_NS::do_make_u32regex(p, p + std::strlen(p), opt, static_cast<boost::mpl::int_<1> const*>(0));
|
||||
}
|
||||
inline u32regex make_u32regex(const unsigned char* p, boost::regex_constants::syntax_option_type opt = boost::regex_constants::perl)
|
||||
{
|
||||
return re_detail::do_make_u32regex(p, p + std::strlen(reinterpret_cast<const char*>(p)), opt, static_cast<boost::mpl::int_<1> const*>(0));
|
||||
return BOOST_REGEX_DETAIL_NS::do_make_u32regex(p, p + std::strlen(reinterpret_cast<const char*>(p)), opt, static_cast<boost::mpl::int_<1> const*>(0));
|
||||
}
|
||||
//
|
||||
// construction from UTF-16 nul-terminated strings:
|
||||
@@ -360,13 +360,13 @@ inline u32regex make_u32regex(const unsigned char* p, boost::regex_constants::sy
|
||||
#ifndef BOOST_NO_WREGEX
|
||||
inline u32regex make_u32regex(const wchar_t* p, boost::regex_constants::syntax_option_type opt = boost::regex_constants::perl)
|
||||
{
|
||||
return re_detail::do_make_u32regex(p, p + std::wcslen(p), opt, static_cast<boost::mpl::int_<sizeof(wchar_t)> const*>(0));
|
||||
return BOOST_REGEX_DETAIL_NS::do_make_u32regex(p, p + std::wcslen(p), opt, static_cast<boost::mpl::int_<sizeof(wchar_t)> const*>(0));
|
||||
}
|
||||
#endif
|
||||
#if !defined(U_WCHAR_IS_UTF16) && (U_SIZEOF_WCHAR_T != 2)
|
||||
inline u32regex make_u32regex(const UChar* p, boost::regex_constants::syntax_option_type opt = boost::regex_constants::perl)
|
||||
{
|
||||
return re_detail::do_make_u32regex(p, p + u_strlen(p), opt, static_cast<boost::mpl::int_<2> const*>(0));
|
||||
return BOOST_REGEX_DETAIL_NS::do_make_u32regex(p, p + u_strlen(p), opt, static_cast<boost::mpl::int_<2> const*>(0));
|
||||
}
|
||||
#endif
|
||||
//
|
||||
@@ -375,20 +375,20 @@ inline u32regex make_u32regex(const UChar* p, boost::regex_constants::syntax_opt
|
||||
template<class C, class T, class A>
|
||||
inline u32regex make_u32regex(const std::basic_string<C, T, A>& s, boost::regex_constants::syntax_option_type opt = boost::regex_constants::perl)
|
||||
{
|
||||
return re_detail::do_make_u32regex(s.begin(), s.end(), opt, static_cast<boost::mpl::int_<sizeof(C)> const*>(0));
|
||||
return BOOST_REGEX_DETAIL_NS::do_make_u32regex(s.begin(), s.end(), opt, static_cast<boost::mpl::int_<sizeof(C)> const*>(0));
|
||||
}
|
||||
//
|
||||
// Construction from ICU string type:
|
||||
//
|
||||
inline u32regex make_u32regex(const U_NAMESPACE_QUALIFIER UnicodeString& s, boost::regex_constants::syntax_option_type opt = boost::regex_constants::perl)
|
||||
{
|
||||
return re_detail::do_make_u32regex(s.getBuffer(), s.getBuffer() + s.length(), opt, static_cast<boost::mpl::int_<2> const*>(0));
|
||||
return BOOST_REGEX_DETAIL_NS::do_make_u32regex(s.getBuffer(), s.getBuffer() + s.length(), opt, static_cast<boost::mpl::int_<2> const*>(0));
|
||||
}
|
||||
|
||||
//
|
||||
// regex_match overloads that widen the character type as appropriate:
|
||||
//
|
||||
namespace re_detail{
|
||||
namespace BOOST_REGEX_DETAIL_NS{
|
||||
template<class MR1, class MR2>
|
||||
void copy_results(MR1& out, MR2 const& in)
|
||||
{
|
||||
@@ -446,7 +446,7 @@ bool do_regex_match(BidiIterator first, BidiIterator last,
|
||||
if(result) copy_results(m, what);
|
||||
return result;
|
||||
}
|
||||
} // namespace re_detail
|
||||
} // namespace BOOST_REGEX_DETAIL_NS
|
||||
|
||||
template <class BidiIterator, class Allocator>
|
||||
inline bool u32regex_match(BidiIterator first, BidiIterator last,
|
||||
@@ -454,14 +454,14 @@ inline bool u32regex_match(BidiIterator first, BidiIterator last,
|
||||
const u32regex& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
return re_detail::do_regex_match(first, last, m, e, flags, static_cast<mpl::int_<sizeof(*first)> const*>(0));
|
||||
return BOOST_REGEX_DETAIL_NS::do_regex_match(first, last, m, e, flags, static_cast<mpl::int_<sizeof(*first)> const*>(0));
|
||||
}
|
||||
inline bool u32regex_match(const UChar* p,
|
||||
match_results<const UChar*>& m,
|
||||
const u32regex& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
return re_detail::do_regex_match(p, p+u_strlen(p), m, e, flags, static_cast<mpl::int_<2> const*>(0));
|
||||
return BOOST_REGEX_DETAIL_NS::do_regex_match(p, p+u_strlen(p), m, e, flags, static_cast<mpl::int_<2> const*>(0));
|
||||
}
|
||||
#if !defined(U_WCHAR_IS_UTF16) && (U_SIZEOF_WCHAR_T != 2) && !defined(BOOST_NO_WREGEX)
|
||||
inline bool u32regex_match(const wchar_t* p,
|
||||
@@ -469,7 +469,7 @@ inline bool u32regex_match(const wchar_t* p,
|
||||
const u32regex& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
return re_detail::do_regex_match(p, p+std::wcslen(p), m, e, flags, static_cast<mpl::int_<sizeof(wchar_t)> const*>(0));
|
||||
return BOOST_REGEX_DETAIL_NS::do_regex_match(p, p+std::wcslen(p), m, e, flags, static_cast<mpl::int_<sizeof(wchar_t)> const*>(0));
|
||||
}
|
||||
#endif
|
||||
inline bool u32regex_match(const char* p,
|
||||
@@ -477,21 +477,21 @@ inline bool u32regex_match(const char* p,
|
||||
const u32regex& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
return re_detail::do_regex_match(p, p+std::strlen(p), m, e, flags, static_cast<mpl::int_<1> const*>(0));
|
||||
return BOOST_REGEX_DETAIL_NS::do_regex_match(p, p+std::strlen(p), m, e, flags, static_cast<mpl::int_<1> const*>(0));
|
||||
}
|
||||
inline bool u32regex_match(const unsigned char* p,
|
||||
match_results<const unsigned char*>& m,
|
||||
const u32regex& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
return re_detail::do_regex_match(p, p+std::strlen((const char*)p), m, e, flags, static_cast<mpl::int_<1> const*>(0));
|
||||
return BOOST_REGEX_DETAIL_NS::do_regex_match(p, p+std::strlen((const char*)p), m, e, flags, static_cast<mpl::int_<1> const*>(0));
|
||||
}
|
||||
inline bool u32regex_match(const std::string& s,
|
||||
match_results<std::string::const_iterator>& m,
|
||||
const u32regex& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
return re_detail::do_regex_match(s.begin(), s.end(), m, e, flags, static_cast<mpl::int_<1> const*>(0));
|
||||
return BOOST_REGEX_DETAIL_NS::do_regex_match(s.begin(), s.end(), m, e, flags, static_cast<mpl::int_<1> const*>(0));
|
||||
}
|
||||
#ifndef BOOST_NO_STD_WSTRING
|
||||
inline bool u32regex_match(const std::wstring& s,
|
||||
@@ -499,7 +499,7 @@ inline bool u32regex_match(const std::wstring& s,
|
||||
const u32regex& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
return re_detail::do_regex_match(s.begin(), s.end(), m, e, flags, static_cast<mpl::int_<sizeof(wchar_t)> const*>(0));
|
||||
return BOOST_REGEX_DETAIL_NS::do_regex_match(s.begin(), s.end(), m, e, flags, static_cast<mpl::int_<sizeof(wchar_t)> const*>(0));
|
||||
}
|
||||
#endif
|
||||
inline bool u32regex_match(const U_NAMESPACE_QUALIFIER UnicodeString& s,
|
||||
@@ -507,7 +507,7 @@ inline bool u32regex_match(const U_NAMESPACE_QUALIFIER UnicodeString& s,
|
||||
const u32regex& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
return re_detail::do_regex_match(s.getBuffer(), s.getBuffer() + s.length(), m, e, flags, static_cast<mpl::int_<sizeof(wchar_t)> const*>(0));
|
||||
return BOOST_REGEX_DETAIL_NS::do_regex_match(s.getBuffer(), s.getBuffer() + s.length(), m, e, flags, static_cast<mpl::int_<sizeof(wchar_t)> const*>(0));
|
||||
}
|
||||
//
|
||||
// regex_match overloads that do not return what matched:
|
||||
@@ -518,14 +518,14 @@ inline bool u32regex_match(BidiIterator first, BidiIterator last,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
match_results<BidiIterator> m;
|
||||
return re_detail::do_regex_match(first, last, m, e, flags, static_cast<mpl::int_<sizeof(*first)> const*>(0));
|
||||
return BOOST_REGEX_DETAIL_NS::do_regex_match(first, last, m, e, flags, static_cast<mpl::int_<sizeof(*first)> const*>(0));
|
||||
}
|
||||
inline bool u32regex_match(const UChar* p,
|
||||
const u32regex& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
match_results<const UChar*> m;
|
||||
return re_detail::do_regex_match(p, p+u_strlen(p), m, e, flags, static_cast<mpl::int_<2> const*>(0));
|
||||
return BOOST_REGEX_DETAIL_NS::do_regex_match(p, p+u_strlen(p), m, e, flags, static_cast<mpl::int_<2> const*>(0));
|
||||
}
|
||||
#if !defined(U_WCHAR_IS_UTF16) && (U_SIZEOF_WCHAR_T != 2) && !defined(BOOST_NO_WREGEX)
|
||||
inline bool u32regex_match(const wchar_t* p,
|
||||
@@ -533,7 +533,7 @@ inline bool u32regex_match(const wchar_t* p,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
match_results<const wchar_t*> m;
|
||||
return re_detail::do_regex_match(p, p+std::wcslen(p), m, e, flags, static_cast<mpl::int_<sizeof(wchar_t)> const*>(0));
|
||||
return BOOST_REGEX_DETAIL_NS::do_regex_match(p, p+std::wcslen(p), m, e, flags, static_cast<mpl::int_<sizeof(wchar_t)> const*>(0));
|
||||
}
|
||||
#endif
|
||||
inline bool u32regex_match(const char* p,
|
||||
@@ -541,21 +541,21 @@ inline bool u32regex_match(const char* p,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
match_results<const char*> m;
|
||||
return re_detail::do_regex_match(p, p+std::strlen(p), m, e, flags, static_cast<mpl::int_<1> const*>(0));
|
||||
return BOOST_REGEX_DETAIL_NS::do_regex_match(p, p+std::strlen(p), m, e, flags, static_cast<mpl::int_<1> const*>(0));
|
||||
}
|
||||
inline bool u32regex_match(const unsigned char* p,
|
||||
const u32regex& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
match_results<const unsigned char*> m;
|
||||
return re_detail::do_regex_match(p, p+std::strlen((const char*)p), m, e, flags, static_cast<mpl::int_<1> const*>(0));
|
||||
return BOOST_REGEX_DETAIL_NS::do_regex_match(p, p+std::strlen((const char*)p), m, e, flags, static_cast<mpl::int_<1> const*>(0));
|
||||
}
|
||||
inline bool u32regex_match(const std::string& s,
|
||||
const u32regex& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
match_results<std::string::const_iterator> m;
|
||||
return re_detail::do_regex_match(s.begin(), s.end(), m, e, flags, static_cast<mpl::int_<1> const*>(0));
|
||||
return BOOST_REGEX_DETAIL_NS::do_regex_match(s.begin(), s.end(), m, e, flags, static_cast<mpl::int_<1> const*>(0));
|
||||
}
|
||||
#ifndef BOOST_NO_STD_WSTRING
|
||||
inline bool u32regex_match(const std::wstring& s,
|
||||
@@ -563,7 +563,7 @@ inline bool u32regex_match(const std::wstring& s,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
match_results<std::wstring::const_iterator> m;
|
||||
return re_detail::do_regex_match(s.begin(), s.end(), m, e, flags, static_cast<mpl::int_<sizeof(wchar_t)> const*>(0));
|
||||
return BOOST_REGEX_DETAIL_NS::do_regex_match(s.begin(), s.end(), m, e, flags, static_cast<mpl::int_<sizeof(wchar_t)> const*>(0));
|
||||
}
|
||||
#endif
|
||||
inline bool u32regex_match(const U_NAMESPACE_QUALIFIER UnicodeString& s,
|
||||
@@ -571,13 +571,13 @@ inline bool u32regex_match(const U_NAMESPACE_QUALIFIER UnicodeString& s,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
match_results<const UChar*> m;
|
||||
return re_detail::do_regex_match(s.getBuffer(), s.getBuffer() + s.length(), m, e, flags, static_cast<mpl::int_<sizeof(wchar_t)> const*>(0));
|
||||
return BOOST_REGEX_DETAIL_NS::do_regex_match(s.getBuffer(), s.getBuffer() + s.length(), m, e, flags, static_cast<mpl::int_<sizeof(wchar_t)> const*>(0));
|
||||
}
|
||||
|
||||
//
|
||||
// regex_search overloads that widen the character type as appropriate:
|
||||
//
|
||||
namespace re_detail{
|
||||
namespace BOOST_REGEX_DETAIL_NS{
|
||||
template <class BidiIterator, class Allocator>
|
||||
inline bool do_regex_search(BidiIterator first, BidiIterator last,
|
||||
match_results<BidiIterator, Allocator>& m,
|
||||
@@ -630,7 +630,7 @@ inline bool u32regex_search(BidiIterator first, BidiIterator last,
|
||||
const u32regex& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
return re_detail::do_regex_search(first, last, m, e, flags, first, static_cast<mpl::int_<sizeof(*first)> const*>(0));
|
||||
return BOOST_REGEX_DETAIL_NS::do_regex_search(first, last, m, e, flags, first, static_cast<mpl::int_<sizeof(*first)> const*>(0));
|
||||
}
|
||||
template <class BidiIterator, class Allocator>
|
||||
inline bool u32regex_search(BidiIterator first, BidiIterator last,
|
||||
@@ -639,14 +639,14 @@ inline bool u32regex_search(BidiIterator first, BidiIterator last,
|
||||
match_flag_type flags,
|
||||
BidiIterator base)
|
||||
{
|
||||
return re_detail::do_regex_search(first, last, m, e, flags, base, static_cast<mpl::int_<sizeof(*first)> const*>(0));
|
||||
return BOOST_REGEX_DETAIL_NS::do_regex_search(first, last, m, e, flags, base, static_cast<mpl::int_<sizeof(*first)> const*>(0));
|
||||
}
|
||||
inline bool u32regex_search(const UChar* p,
|
||||
match_results<const UChar*>& m,
|
||||
const u32regex& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
return re_detail::do_regex_search(p, p+u_strlen(p), m, e, flags, p, static_cast<mpl::int_<2> const*>(0));
|
||||
return BOOST_REGEX_DETAIL_NS::do_regex_search(p, p+u_strlen(p), m, e, flags, p, static_cast<mpl::int_<2> const*>(0));
|
||||
}
|
||||
#if !defined(U_WCHAR_IS_UTF16) && (U_SIZEOF_WCHAR_T != 2) && !defined(BOOST_NO_WREGEX)
|
||||
inline bool u32regex_search(const wchar_t* p,
|
||||
@@ -654,7 +654,7 @@ inline bool u32regex_search(const wchar_t* p,
|
||||
const u32regex& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
return re_detail::do_regex_search(p, p+std::wcslen(p), m, e, flags, p, static_cast<mpl::int_<sizeof(wchar_t)> const*>(0));
|
||||
return BOOST_REGEX_DETAIL_NS::do_regex_search(p, p+std::wcslen(p), m, e, flags, p, static_cast<mpl::int_<sizeof(wchar_t)> const*>(0));
|
||||
}
|
||||
#endif
|
||||
inline bool u32regex_search(const char* p,
|
||||
@@ -662,21 +662,21 @@ inline bool u32regex_search(const char* p,
|
||||
const u32regex& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
return re_detail::do_regex_search(p, p+std::strlen(p), m, e, flags, p, static_cast<mpl::int_<1> const*>(0));
|
||||
return BOOST_REGEX_DETAIL_NS::do_regex_search(p, p+std::strlen(p), m, e, flags, p, static_cast<mpl::int_<1> const*>(0));
|
||||
}
|
||||
inline bool u32regex_search(const unsigned char* p,
|
||||
match_results<const unsigned char*>& m,
|
||||
const u32regex& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
return re_detail::do_regex_search(p, p+std::strlen((const char*)p), m, e, flags, p, static_cast<mpl::int_<1> const*>(0));
|
||||
return BOOST_REGEX_DETAIL_NS::do_regex_search(p, p+std::strlen((const char*)p), m, e, flags, p, static_cast<mpl::int_<1> const*>(0));
|
||||
}
|
||||
inline bool u32regex_search(const std::string& s,
|
||||
match_results<std::string::const_iterator>& m,
|
||||
const u32regex& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
return re_detail::do_regex_search(s.begin(), s.end(), m, e, flags, s.begin(), static_cast<mpl::int_<1> const*>(0));
|
||||
return BOOST_REGEX_DETAIL_NS::do_regex_search(s.begin(), s.end(), m, e, flags, s.begin(), static_cast<mpl::int_<1> const*>(0));
|
||||
}
|
||||
#ifndef BOOST_NO_STD_WSTRING
|
||||
inline bool u32regex_search(const std::wstring& s,
|
||||
@@ -684,7 +684,7 @@ inline bool u32regex_search(const std::wstring& s,
|
||||
const u32regex& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
return re_detail::do_regex_search(s.begin(), s.end(), m, e, flags, s.begin(), static_cast<mpl::int_<sizeof(wchar_t)> const*>(0));
|
||||
return BOOST_REGEX_DETAIL_NS::do_regex_search(s.begin(), s.end(), m, e, flags, s.begin(), static_cast<mpl::int_<sizeof(wchar_t)> const*>(0));
|
||||
}
|
||||
#endif
|
||||
inline bool u32regex_search(const U_NAMESPACE_QUALIFIER UnicodeString& s,
|
||||
@@ -692,7 +692,7 @@ inline bool u32regex_search(const U_NAMESPACE_QUALIFIER UnicodeString& s,
|
||||
const u32regex& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
return re_detail::do_regex_search(s.getBuffer(), s.getBuffer() + s.length(), m, e, flags, s.getBuffer(), static_cast<mpl::int_<sizeof(wchar_t)> const*>(0));
|
||||
return BOOST_REGEX_DETAIL_NS::do_regex_search(s.getBuffer(), s.getBuffer() + s.length(), m, e, flags, s.getBuffer(), static_cast<mpl::int_<sizeof(wchar_t)> const*>(0));
|
||||
}
|
||||
template <class BidiIterator>
|
||||
inline bool u32regex_search(BidiIterator first, BidiIterator last,
|
||||
@@ -700,14 +700,14 @@ inline bool u32regex_search(BidiIterator first, BidiIterator last,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
match_results<BidiIterator> m;
|
||||
return re_detail::do_regex_search(first, last, m, e, flags, first, static_cast<mpl::int_<sizeof(*first)> const*>(0));
|
||||
return BOOST_REGEX_DETAIL_NS::do_regex_search(first, last, m, e, flags, first, static_cast<mpl::int_<sizeof(*first)> const*>(0));
|
||||
}
|
||||
inline bool u32regex_search(const UChar* p,
|
||||
const u32regex& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
match_results<const UChar*> m;
|
||||
return re_detail::do_regex_search(p, p+u_strlen(p), m, e, flags, p, static_cast<mpl::int_<2> const*>(0));
|
||||
return BOOST_REGEX_DETAIL_NS::do_regex_search(p, p+u_strlen(p), m, e, flags, p, static_cast<mpl::int_<2> const*>(0));
|
||||
}
|
||||
#if !defined(U_WCHAR_IS_UTF16) && (U_SIZEOF_WCHAR_T != 2) && !defined(BOOST_NO_WREGEX)
|
||||
inline bool u32regex_search(const wchar_t* p,
|
||||
@@ -715,7 +715,7 @@ inline bool u32regex_search(const wchar_t* p,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
match_results<const wchar_t*> m;
|
||||
return re_detail::do_regex_search(p, p+std::wcslen(p), m, e, flags, p, static_cast<mpl::int_<sizeof(wchar_t)> const*>(0));
|
||||
return BOOST_REGEX_DETAIL_NS::do_regex_search(p, p+std::wcslen(p), m, e, flags, p, static_cast<mpl::int_<sizeof(wchar_t)> const*>(0));
|
||||
}
|
||||
#endif
|
||||
inline bool u32regex_search(const char* p,
|
||||
@@ -723,21 +723,21 @@ inline bool u32regex_search(const char* p,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
match_results<const char*> m;
|
||||
return re_detail::do_regex_search(p, p+std::strlen(p), m, e, flags, p, static_cast<mpl::int_<1> const*>(0));
|
||||
return BOOST_REGEX_DETAIL_NS::do_regex_search(p, p+std::strlen(p), m, e, flags, p, static_cast<mpl::int_<1> const*>(0));
|
||||
}
|
||||
inline bool u32regex_search(const unsigned char* p,
|
||||
const u32regex& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
match_results<const unsigned char*> m;
|
||||
return re_detail::do_regex_search(p, p+std::strlen((const char*)p), m, e, flags, p, static_cast<mpl::int_<1> const*>(0));
|
||||
return BOOST_REGEX_DETAIL_NS::do_regex_search(p, p+std::strlen((const char*)p), m, e, flags, p, static_cast<mpl::int_<1> const*>(0));
|
||||
}
|
||||
inline bool u32regex_search(const std::string& s,
|
||||
const u32regex& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
match_results<std::string::const_iterator> m;
|
||||
return re_detail::do_regex_search(s.begin(), s.end(), m, e, flags, s.begin(), static_cast<mpl::int_<1> const*>(0));
|
||||
return BOOST_REGEX_DETAIL_NS::do_regex_search(s.begin(), s.end(), m, e, flags, s.begin(), static_cast<mpl::int_<1> const*>(0));
|
||||
}
|
||||
#ifndef BOOST_NO_STD_WSTRING
|
||||
inline bool u32regex_search(const std::wstring& s,
|
||||
@@ -745,7 +745,7 @@ inline bool u32regex_search(const std::wstring& s,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
match_results<std::wstring::const_iterator> m;
|
||||
return re_detail::do_regex_search(s.begin(), s.end(), m, e, flags, s.begin(), static_cast<mpl::int_<sizeof(wchar_t)> const*>(0));
|
||||
return BOOST_REGEX_DETAIL_NS::do_regex_search(s.begin(), s.end(), m, e, flags, s.begin(), static_cast<mpl::int_<sizeof(wchar_t)> const*>(0));
|
||||
}
|
||||
#endif
|
||||
inline bool u32regex_search(const U_NAMESPACE_QUALIFIER UnicodeString& s,
|
||||
@@ -753,13 +753,13 @@ inline bool u32regex_search(const U_NAMESPACE_QUALIFIER UnicodeString& s,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
match_results<const UChar*> m;
|
||||
return re_detail::do_regex_search(s.getBuffer(), s.getBuffer() + s.length(), m, e, flags, s.getBuffer(), static_cast<mpl::int_<sizeof(wchar_t)> const*>(0));
|
||||
return BOOST_REGEX_DETAIL_NS::do_regex_search(s.getBuffer(), s.getBuffer() + s.length(), m, e, flags, s.getBuffer(), static_cast<mpl::int_<sizeof(wchar_t)> const*>(0));
|
||||
}
|
||||
|
||||
//
|
||||
// overloads for regex_replace with utf-8 and utf-16 data types:
|
||||
//
|
||||
namespace re_detail{
|
||||
namespace BOOST_REGEX_DETAIL_NS{
|
||||
template <class I>
|
||||
inline std::pair< boost::u8_to_u32_iterator<I>, boost::u8_to_u32_iterator<I> >
|
||||
make_utf32_seq(I i, I j, mpl::int_<1> const*)
|
||||
@@ -838,7 +838,7 @@ OutputIterator do_regex_replace(OutputIterator out,
|
||||
if(i == j)
|
||||
{
|
||||
if(!(flags & regex_constants::format_no_copy))
|
||||
out = re_detail::copy(in.first, in.second, out);
|
||||
out = BOOST_REGEX_DETAIL_NS::copy(in.first, in.second, out);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -846,18 +846,18 @@ OutputIterator do_regex_replace(OutputIterator out,
|
||||
while(i != j)
|
||||
{
|
||||
if(!(flags & regex_constants::format_no_copy))
|
||||
out = re_detail::copy(i->prefix().first, i->prefix().second, out);
|
||||
out = BOOST_REGEX_DETAIL_NS::copy(i->prefix().first, i->prefix().second, out);
|
||||
if(f.size())
|
||||
out = ::boost::re_detail::regex_format_imp(out, *i, &*f.begin(), &*f.begin() + f.size(), flags, e.get_traits());
|
||||
out = ::boost::BOOST_REGEX_DETAIL_NS::regex_format_imp(out, *i, &*f.begin(), &*f.begin() + f.size(), flags, e.get_traits());
|
||||
else
|
||||
out = ::boost::re_detail::regex_format_imp(out, *i, static_cast<UChar32 const*>(0), static_cast<UChar32 const*>(0), flags, e.get_traits());
|
||||
out = ::boost::BOOST_REGEX_DETAIL_NS::regex_format_imp(out, *i, static_cast<UChar32 const*>(0), static_cast<UChar32 const*>(0), flags, e.get_traits());
|
||||
last_m = (*i)[0].second;
|
||||
if(flags & regex_constants::format_first_only)
|
||||
break;
|
||||
++i;
|
||||
}
|
||||
if(!(flags & regex_constants::format_no_copy))
|
||||
out = re_detail::copy(last_m, in.second, out);
|
||||
out = BOOST_REGEX_DETAIL_NS::copy(last_m, in.second, out);
|
||||
}
|
||||
return out;
|
||||
}
|
||||
@@ -876,7 +876,7 @@ inline BaseIterator extract_output_base(const utf16_output_iterator<BaseIterator
|
||||
{
|
||||
return b.base();
|
||||
}
|
||||
} // re_detail
|
||||
} // BOOST_REGEX_DETAIL_NS
|
||||
|
||||
template <class OutputIterator, class BidirectionalIterator, class charT>
|
||||
inline OutputIterator u32regex_replace(OutputIterator out,
|
||||
@@ -886,13 +886,13 @@ inline OutputIterator u32regex_replace(OutputIterator out,
|
||||
const charT* fmt,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
return re_detail::extract_output_base
|
||||
return BOOST_REGEX_DETAIL_NS::extract_output_base
|
||||
(
|
||||
re_detail::do_regex_replace(
|
||||
re_detail::make_utf32_out(out, static_cast<mpl::int_<sizeof(*first)> const*>(0)),
|
||||
re_detail::make_utf32_seq(first, last, static_cast<mpl::int_<sizeof(*first)> const*>(0)),
|
||||
BOOST_REGEX_DETAIL_NS::do_regex_replace(
|
||||
BOOST_REGEX_DETAIL_NS::make_utf32_out(out, static_cast<mpl::int_<sizeof(*first)> const*>(0)),
|
||||
BOOST_REGEX_DETAIL_NS::make_utf32_seq(first, last, static_cast<mpl::int_<sizeof(*first)> const*>(0)),
|
||||
e,
|
||||
re_detail::make_utf32_seq(fmt, static_cast<mpl::int_<sizeof(*fmt)> const*>(0)),
|
||||
BOOST_REGEX_DETAIL_NS::make_utf32_seq(fmt, static_cast<mpl::int_<sizeof(*fmt)> const*>(0)),
|
||||
flags)
|
||||
);
|
||||
}
|
||||
@@ -905,13 +905,13 @@ inline OutputIterator u32regex_replace(OutputIterator out,
|
||||
const std::basic_string<charT>& fmt,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
return re_detail::extract_output_base
|
||||
return BOOST_REGEX_DETAIL_NS::extract_output_base
|
||||
(
|
||||
re_detail::do_regex_replace(
|
||||
re_detail::make_utf32_out(out, static_cast<mpl::int_<sizeof(*first)> const*>(0)),
|
||||
re_detail::make_utf32_seq(first, last, static_cast<mpl::int_<sizeof(*first)> const*>(0)),
|
||||
BOOST_REGEX_DETAIL_NS::do_regex_replace(
|
||||
BOOST_REGEX_DETAIL_NS::make_utf32_out(out, static_cast<mpl::int_<sizeof(*first)> const*>(0)),
|
||||
BOOST_REGEX_DETAIL_NS::make_utf32_seq(first, last, static_cast<mpl::int_<sizeof(*first)> const*>(0)),
|
||||
e,
|
||||
re_detail::make_utf32_seq(fmt.begin(), fmt.end(), static_cast<mpl::int_<sizeof(charT)> const*>(0)),
|
||||
BOOST_REGEX_DETAIL_NS::make_utf32_seq(fmt.begin(), fmt.end(), static_cast<mpl::int_<sizeof(charT)> const*>(0)),
|
||||
flags)
|
||||
);
|
||||
}
|
||||
@@ -924,13 +924,13 @@ inline OutputIterator u32regex_replace(OutputIterator out,
|
||||
const U_NAMESPACE_QUALIFIER UnicodeString& fmt,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
return re_detail::extract_output_base
|
||||
return BOOST_REGEX_DETAIL_NS::extract_output_base
|
||||
(
|
||||
re_detail::do_regex_replace(
|
||||
re_detail::make_utf32_out(out, static_cast<mpl::int_<sizeof(*first)> const*>(0)),
|
||||
re_detail::make_utf32_seq(first, last, static_cast<mpl::int_<sizeof(*first)> const*>(0)),
|
||||
BOOST_REGEX_DETAIL_NS::do_regex_replace(
|
||||
BOOST_REGEX_DETAIL_NS::make_utf32_out(out, static_cast<mpl::int_<sizeof(*first)> const*>(0)),
|
||||
BOOST_REGEX_DETAIL_NS::make_utf32_seq(first, last, static_cast<mpl::int_<sizeof(*first)> const*>(0)),
|
||||
e,
|
||||
re_detail::make_utf32_seq(fmt.getBuffer(), fmt.getBuffer() + fmt.length(), static_cast<mpl::int_<2> const*>(0)),
|
||||
BOOST_REGEX_DETAIL_NS::make_utf32_seq(fmt.getBuffer(), fmt.getBuffer() + fmt.length(), static_cast<mpl::int_<2> const*>(0)),
|
||||
flags)
|
||||
);
|
||||
}
|
||||
@@ -942,7 +942,7 @@ std::basic_string<charT> u32regex_replace(const std::basic_string<charT>& s,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
std::basic_string<charT> result;
|
||||
re_detail::string_out_iterator<std::basic_string<charT> > i(result);
|
||||
BOOST_REGEX_DETAIL_NS::string_out_iterator<std::basic_string<charT> > i(result);
|
||||
u32regex_replace(i, s.begin(), s.end(), e, fmt, flags);
|
||||
return result;
|
||||
}
|
||||
@@ -954,12 +954,12 @@ std::basic_string<charT> u32regex_replace(const std::basic_string<charT>& s,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
std::basic_string<charT> result;
|
||||
re_detail::string_out_iterator<std::basic_string<charT> > i(result);
|
||||
BOOST_REGEX_DETAIL_NS::string_out_iterator<std::basic_string<charT> > i(result);
|
||||
u32regex_replace(i, s.begin(), s.end(), e, fmt.c_str(), flags);
|
||||
return result;
|
||||
}
|
||||
|
||||
namespace re_detail{
|
||||
namespace BOOST_REGEX_DETAIL_NS{
|
||||
|
||||
class unicode_string_out_iterator
|
||||
{
|
||||
@@ -989,7 +989,7 @@ inline U_NAMESPACE_QUALIFIER UnicodeString u32regex_replace(const U_NAMESPACE_QU
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
U_NAMESPACE_QUALIFIER UnicodeString result;
|
||||
re_detail::unicode_string_out_iterator i(result);
|
||||
BOOST_REGEX_DETAIL_NS::unicode_string_out_iterator i(result);
|
||||
u32regex_replace(i, s.getBuffer(), s.getBuffer()+s.length(), e, fmt, flags);
|
||||
return result;
|
||||
}
|
||||
@@ -1000,12 +1000,12 @@ inline U_NAMESPACE_QUALIFIER UnicodeString u32regex_replace(const U_NAMESPACE_QU
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
U_NAMESPACE_QUALIFIER UnicodeString result;
|
||||
re_detail::unicode_string_out_iterator i(result);
|
||||
re_detail::do_regex_replace(
|
||||
re_detail::make_utf32_out(i, static_cast<mpl::int_<2> const*>(0)),
|
||||
re_detail::make_utf32_seq(s.getBuffer(), s.getBuffer()+s.length(), static_cast<mpl::int_<2> const*>(0)),
|
||||
BOOST_REGEX_DETAIL_NS::unicode_string_out_iterator i(result);
|
||||
BOOST_REGEX_DETAIL_NS::do_regex_replace(
|
||||
BOOST_REGEX_DETAIL_NS::make_utf32_out(i, static_cast<mpl::int_<2> const*>(0)),
|
||||
BOOST_REGEX_DETAIL_NS::make_utf32_seq(s.getBuffer(), s.getBuffer()+s.length(), static_cast<mpl::int_<2> const*>(0)),
|
||||
e,
|
||||
re_detail::make_utf32_seq(fmt.getBuffer(), fmt.getBuffer() + fmt.length(), static_cast<mpl::int_<2> const*>(0)),
|
||||
BOOST_REGEX_DETAIL_NS::make_utf32_seq(fmt.getBuffer(), fmt.getBuffer() + fmt.length(), static_cast<mpl::int_<2> const*>(0)),
|
||||
flags);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -144,7 +144,7 @@ OutputIterator regex_replace(OutputIterator out,
|
||||
return ::boost::regex_replace(out, first, last, e, fmt.GetString(), flags);
|
||||
}
|
||||
|
||||
namespace re_detail{
|
||||
namespace BOOST_REGEX_DETAIL_NS{
|
||||
|
||||
template <class B, bool b>
|
||||
class mfc_string_out_iterator
|
||||
@@ -176,7 +176,7 @@ ATL::CSimpleStringT<B, b> regex_replace(const ATL::CSimpleStringT<B, b>& s,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
ATL::CSimpleStringT<B, b> result(s.GetManager());
|
||||
re_detail::mfc_string_out_iterator<B, b> i(result);
|
||||
BOOST_REGEX_DETAIL_NS::mfc_string_out_iterator<B, b> i(result);
|
||||
regex_replace(i, s.GetString(), s.GetString() + s.GetLength(), e, fmt.GetString(), flags);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ private:
|
||||
typedef regex_error bad_pattern;
|
||||
typedef regex_error bad_expression;
|
||||
|
||||
namespace re_detail{
|
||||
namespace BOOST_REGEX_DETAIL_NS{
|
||||
|
||||
BOOST_REGEX_DECL void BOOST_REGEX_CALL raise_runtime_error(const std::runtime_error& ex);
|
||||
|
||||
@@ -72,7 +72,7 @@ void raise_error(const traits& t, regex_constants::error_type code)
|
||||
{
|
||||
(void)t; // warning suppression
|
||||
std::runtime_error e(t.error_string(code));
|
||||
::boost::re_detail::raise_runtime_error(e);
|
||||
::boost::BOOST_REGEX_DETAIL_NS::raise_runtime_error(e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ namespace boost{
|
||||
#endif
|
||||
#endif
|
||||
|
||||
namespace re_detail{
|
||||
namespace BOOST_REGEX_DETAIL_NS{
|
||||
|
||||
//
|
||||
// forward declaration, we will need this one later:
|
||||
@@ -164,9 +164,9 @@ struct regex_data : public named_subexpressions
|
||||
|
||||
regex_data(const ::boost::shared_ptr<
|
||||
::boost::regex_traits_wrapper<traits> >& t)
|
||||
: m_ptraits(t), m_expression(0), m_expression_len(0) {}
|
||||
: m_ptraits(t), m_expression(0), m_expression_len(0), m_disable_match_any(false) {}
|
||||
regex_data()
|
||||
: m_ptraits(new ::boost::regex_traits_wrapper<traits>()), m_expression(0), m_expression_len(0) {}
|
||||
: m_ptraits(new ::boost::regex_traits_wrapper<traits>()), m_expression(0), m_expression_len(0), m_disable_match_any(false) {}
|
||||
|
||||
::boost::shared_ptr<
|
||||
::boost::regex_traits_wrapper<traits>
|
||||
@@ -176,16 +176,17 @@ struct regex_data : public named_subexpressions
|
||||
const charT* m_expression; // the original expression
|
||||
std::ptrdiff_t m_expression_len; // the length of the original expression
|
||||
size_type m_mark_count; // the number of marked sub-expressions
|
||||
re_detail::re_syntax_base* m_first_state; // the first state of the machine
|
||||
BOOST_REGEX_DETAIL_NS::re_syntax_base* m_first_state; // the first state of the machine
|
||||
unsigned m_restart_type; // search optimisation type
|
||||
unsigned char m_startmap[1 << CHAR_BIT]; // which characters can start a match
|
||||
unsigned int m_can_be_null; // whether we can match a null string
|
||||
re_detail::raw_storage m_data; // the buffer in which our states are constructed
|
||||
BOOST_REGEX_DETAIL_NS::raw_storage m_data; // the buffer in which our states are constructed
|
||||
typename traits::char_class_type m_word_mask; // mask used to determine if a character is a word character
|
||||
std::vector<
|
||||
std::pair<
|
||||
std::size_t, std::size_t> > m_subs; // Position of sub-expressions within the *string*.
|
||||
bool m_has_recursions; // whether we have recursive expressions;
|
||||
bool m_disable_match_any; // when set we need to disable the match_any flag as it causes different/buggy behaviour.
|
||||
};
|
||||
//
|
||||
// class basic_regex_implementation
|
||||
@@ -266,7 +267,7 @@ public:
|
||||
{
|
||||
return this->m_mark_count - 1;
|
||||
}
|
||||
const re_detail::re_syntax_base* get_first_state()const
|
||||
const BOOST_REGEX_DETAIL_NS::re_syntax_base* get_first_state()const
|
||||
{
|
||||
return this->m_first_state;
|
||||
}
|
||||
@@ -293,7 +294,7 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace re_detail
|
||||
} // namespace BOOST_REGEX_DETAIL_NS
|
||||
//
|
||||
// class basic_regex:
|
||||
// represents the compiled
|
||||
@@ -597,7 +598,7 @@ public:
|
||||
//
|
||||
// private access methods:
|
||||
//
|
||||
const re_detail::re_syntax_base* get_first_state()const
|
||||
const BOOST_REGEX_DETAIL_NS::re_syntax_base* get_first_state()const
|
||||
{
|
||||
BOOST_ASSERT(0 != m_pimpl.get());
|
||||
return m_pimpl->get_first_state();
|
||||
@@ -622,18 +623,18 @@ public:
|
||||
BOOST_ASSERT(0 != m_pimpl.get());
|
||||
return m_pimpl->can_be_null();
|
||||
}
|
||||
const re_detail::regex_data<charT, traits>& get_data()const
|
||||
const BOOST_REGEX_DETAIL_NS::regex_data<charT, traits>& get_data()const
|
||||
{
|
||||
BOOST_ASSERT(0 != m_pimpl.get());
|
||||
return m_pimpl->get_data();
|
||||
}
|
||||
boost::shared_ptr<re_detail::named_subexpressions > get_named_subs()const
|
||||
boost::shared_ptr<BOOST_REGEX_DETAIL_NS::named_subexpressions > get_named_subs()const
|
||||
{
|
||||
return m_pimpl;
|
||||
}
|
||||
|
||||
private:
|
||||
shared_ptr<re_detail::basic_regex_implementation<charT, traits> > m_pimpl;
|
||||
shared_ptr<BOOST_REGEX_DETAIL_NS::basic_regex_implementation<charT, traits> > m_pimpl;
|
||||
};
|
||||
|
||||
//
|
||||
@@ -647,14 +648,14 @@ basic_regex<charT, traits>& basic_regex<charT, traits>::do_assign(const charT* p
|
||||
const charT* p2,
|
||||
flag_type f)
|
||||
{
|
||||
shared_ptr<re_detail::basic_regex_implementation<charT, traits> > temp;
|
||||
shared_ptr<BOOST_REGEX_DETAIL_NS::basic_regex_implementation<charT, traits> > temp;
|
||||
if(!m_pimpl.get())
|
||||
{
|
||||
temp = shared_ptr<re_detail::basic_regex_implementation<charT, traits> >(new re_detail::basic_regex_implementation<charT, traits>());
|
||||
temp = shared_ptr<BOOST_REGEX_DETAIL_NS::basic_regex_implementation<charT, traits> >(new BOOST_REGEX_DETAIL_NS::basic_regex_implementation<charT, traits>());
|
||||
}
|
||||
else
|
||||
{
|
||||
temp = shared_ptr<re_detail::basic_regex_implementation<charT, traits> >(new re_detail::basic_regex_implementation<charT, traits>(m_pimpl->m_ptraits));
|
||||
temp = shared_ptr<BOOST_REGEX_DETAIL_NS::basic_regex_implementation<charT, traits> >(new BOOST_REGEX_DETAIL_NS::basic_regex_implementation<charT, traits>(m_pimpl->m_ptraits));
|
||||
}
|
||||
temp->assign(p1, p2, f);
|
||||
temp.swap(m_pimpl);
|
||||
@@ -664,7 +665,7 @@ basic_regex<charT, traits>& basic_regex<charT, traits>::do_assign(const charT* p
|
||||
template <class charT, class traits>
|
||||
typename basic_regex<charT, traits>::locale_type BOOST_REGEX_CALL basic_regex<charT, traits>::imbue(locale_type l)
|
||||
{
|
||||
shared_ptr<re_detail::basic_regex_implementation<charT, traits> > temp(new re_detail::basic_regex_implementation<charT, traits>());
|
||||
shared_ptr<BOOST_REGEX_DETAIL_NS::basic_regex_implementation<charT, traits> > temp(new BOOST_REGEX_DETAIL_NS::basic_regex_implementation<charT, traits>());
|
||||
locale_type result = temp->imbue(l);
|
||||
temp.swap(m_pimpl);
|
||||
return result;
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
|
||||
namespace boost{
|
||||
|
||||
namespace re_detail{
|
||||
namespace BOOST_REGEX_DETAIL_NS{
|
||||
|
||||
template <class charT>
|
||||
struct digraph : public std::pair<charT, charT>
|
||||
@@ -371,9 +371,9 @@ re_syntax_base* basic_regex_creator<charT, traits>::append_set(
|
||||
//
|
||||
// fill in the basics:
|
||||
//
|
||||
result->csingles = static_cast<unsigned int>(::boost::re_detail::distance(char_set.singles_begin(), char_set.singles_end()));
|
||||
result->cranges = static_cast<unsigned int>(::boost::re_detail::distance(char_set.ranges_begin(), char_set.ranges_end())) / 2;
|
||||
result->cequivalents = static_cast<unsigned int>(::boost::re_detail::distance(char_set.equivalents_begin(), char_set.equivalents_end()));
|
||||
result->csingles = static_cast<unsigned int>(::boost::BOOST_REGEX_DETAIL_NS::distance(char_set.singles_begin(), char_set.singles_end()));
|
||||
result->cranges = static_cast<unsigned int>(::boost::BOOST_REGEX_DETAIL_NS::distance(char_set.ranges_begin(), char_set.ranges_end())) / 2;
|
||||
result->cequivalents = static_cast<unsigned int>(::boost::BOOST_REGEX_DETAIL_NS::distance(char_set.equivalents_begin(), char_set.equivalents_end()));
|
||||
result->cclasses = char_set.classes();
|
||||
result->cnclasses = char_set.negated_classes();
|
||||
if(flags() & regbase::icase)
|
||||
@@ -463,10 +463,10 @@ re_syntax_base* basic_regex_creator<charT, traits>::append_set(
|
||||
return 0;
|
||||
}
|
||||
charT* p = static_cast<charT*>(this->m_pdata->m_data.extend(sizeof(charT) * (s1.size() + s2.size() + 2) ) );
|
||||
re_detail::copy(s1.begin(), s1.end(), p);
|
||||
BOOST_REGEX_DETAIL_NS::copy(s1.begin(), s1.end(), p);
|
||||
p[s1.size()] = charT(0);
|
||||
p += s1.size() + 1;
|
||||
re_detail::copy(s2.begin(), s2.end(), p);
|
||||
BOOST_REGEX_DETAIL_NS::copy(s2.begin(), s2.end(), p);
|
||||
p[s2.size()] = charT(0);
|
||||
}
|
||||
//
|
||||
@@ -487,7 +487,7 @@ re_syntax_base* basic_regex_creator<charT, traits>::append_set(
|
||||
if(s.empty())
|
||||
return 0; // invalid or unsupported equivalence class
|
||||
charT* p = static_cast<charT*>(this->m_pdata->m_data.extend(sizeof(charT) * (s.size()+1) ) );
|
||||
re_detail::copy(s.begin(), s.end(), p);
|
||||
BOOST_REGEX_DETAIL_NS::copy(s.begin(), s.end(), p);
|
||||
p[s.size()] = charT(0);
|
||||
++first;
|
||||
}
|
||||
@@ -664,7 +664,7 @@ void basic_regex_creator<charT, traits>::finalize(const charT* p1, const charT*
|
||||
m_pdata->m_expression_len = len;
|
||||
charT* ps = static_cast<charT*>(m_pdata->m_data.extend(sizeof(charT) * (1 + (p2 - p1))));
|
||||
m_pdata->m_expression = ps;
|
||||
re_detail::copy(p1, p2, ps);
|
||||
BOOST_REGEX_DETAIL_NS::copy(p1, p2, ps);
|
||||
ps[p2 - p1] = 0;
|
||||
// fill in our other data...
|
||||
// successful parsing implies a zero status:
|
||||
@@ -1149,6 +1149,7 @@ void basic_regex_creator<charT, traits>::create_startmap(re_syntax_base* state,
|
||||
set_all_masks(l_map, mask);
|
||||
return;
|
||||
}
|
||||
case syntax_element_accept:
|
||||
case syntax_element_match:
|
||||
{
|
||||
// must be null, any character can match:
|
||||
@@ -1335,6 +1336,11 @@ void basic_regex_creator<charT, traits>::create_startmap(re_syntax_base* state,
|
||||
state = state->next.p;
|
||||
break;
|
||||
|
||||
case syntax_element_commit:
|
||||
set_all_masks(l_map, mask);
|
||||
// Continue scanning so we can figure out whether we can be null:
|
||||
state = state->next.p;
|
||||
break;
|
||||
case syntax_element_startmark:
|
||||
// need to handle independent subs as a special case:
|
||||
if(static_cast<re_brace*>(state)->index == -3)
|
||||
@@ -1456,15 +1462,15 @@ syntax_element_type basic_regex_creator<charT, traits>::get_repeat_type(re_synta
|
||||
{
|
||||
switch(state->next.p->type)
|
||||
{
|
||||
case re_detail::syntax_element_wild:
|
||||
return re_detail::syntax_element_dot_rep;
|
||||
case re_detail::syntax_element_literal:
|
||||
return re_detail::syntax_element_char_rep;
|
||||
case re_detail::syntax_element_set:
|
||||
return re_detail::syntax_element_short_set_rep;
|
||||
case re_detail::syntax_element_long_set:
|
||||
if(static_cast<re_detail::re_set_long<m_type>*>(state->next.p)->singleton)
|
||||
return re_detail::syntax_element_long_set_rep;
|
||||
case BOOST_REGEX_DETAIL_NS::syntax_element_wild:
|
||||
return BOOST_REGEX_DETAIL_NS::syntax_element_dot_rep;
|
||||
case BOOST_REGEX_DETAIL_NS::syntax_element_literal:
|
||||
return BOOST_REGEX_DETAIL_NS::syntax_element_char_rep;
|
||||
case BOOST_REGEX_DETAIL_NS::syntax_element_set:
|
||||
return BOOST_REGEX_DETAIL_NS::syntax_element_short_set_rep;
|
||||
case BOOST_REGEX_DETAIL_NS::syntax_element_long_set:
|
||||
if(static_cast<BOOST_REGEX_DETAIL_NS::re_set_long<m_type>*>(state->next.p)->singleton)
|
||||
return BOOST_REGEX_DETAIL_NS::syntax_element_long_set_rep;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -1529,7 +1535,7 @@ void basic_regex_creator<charT, traits>::probe_leading_repeat(re_syntax_base* st
|
||||
}
|
||||
|
||||
|
||||
} // namespace re_detail
|
||||
} // namespace BOOST_REGEX_DETAIL_NS
|
||||
|
||||
} // namespace boost
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
#endif
|
||||
|
||||
namespace boost{
|
||||
namespace re_detail{
|
||||
namespace BOOST_REGEX_DETAIL_NS{
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma warning(push)
|
||||
@@ -68,6 +68,8 @@ public:
|
||||
bool parse_inner_set(basic_char_set<charT, traits>& char_set);
|
||||
bool parse_QE();
|
||||
bool parse_perl_extension();
|
||||
bool parse_perl_verb();
|
||||
bool match_verb(const char*);
|
||||
bool add_emacs_code(bool negate);
|
||||
bool unwind_alts(std::ptrdiff_t last_paren_start);
|
||||
digraph<charT> get_next_set_literal(basic_char_set<charT, traits>& char_set);
|
||||
@@ -165,7 +167,7 @@ void basic_regex_parser<charT, traits>::parse(const charT* p1, const charT* p2,
|
||||
// have had an unexpected ')' :
|
||||
if(!result)
|
||||
{
|
||||
fail(regex_constants::error_paren, ::boost::re_detail::distance(m_base, m_position), "Found a closing ) with no corresponding openening parenthesis.");
|
||||
fail(regex_constants::error_paren, ::boost::BOOST_REGEX_DETAIL_NS::distance(m_base, m_position), "Found a closing ) with no corresponding openening parenthesis.");
|
||||
return;
|
||||
}
|
||||
// if an error has been set then give up now:
|
||||
@@ -421,6 +423,8 @@ bool basic_regex_parser<charT, traits>::parse_open_paren()
|
||||
{
|
||||
if(this->m_traits.syntax_type(*m_position) == regex_constants::syntax_question)
|
||||
return parse_perl_extension();
|
||||
if(this->m_traits.syntax_type(*m_position) == regex_constants::syntax_star)
|
||||
return parse_perl_verb();
|
||||
}
|
||||
//
|
||||
// update our mark count, and append the required state:
|
||||
@@ -489,7 +493,7 @@ bool basic_regex_parser<charT, traits>::parse_open_paren()
|
||||
//
|
||||
if(m_position == m_end)
|
||||
{
|
||||
this->fail(regex_constants::error_paren, ::boost::re_detail::distance(m_base, m_end));
|
||||
this->fail(regex_constants::error_paren, ::boost::BOOST_REGEX_DETAIL_NS::distance(m_base, m_end));
|
||||
return false;
|
||||
}
|
||||
BOOST_ASSERT(this->m_traits.syntax_type(*m_position) == regex_constants::syntax_close_mark);
|
||||
@@ -924,9 +928,9 @@ bool basic_regex_parser<charT, traits>::parse_match_any()
|
||||
static_cast<re_dot*>(
|
||||
this->append_state(syntax_element_wild, sizeof(re_dot))
|
||||
)->mask = static_cast<unsigned char>(this->flags() & regbase::no_mod_s
|
||||
? re_detail::force_not_newline
|
||||
? BOOST_REGEX_DETAIL_NS::force_not_newline
|
||||
: this->flags() & regbase::mod_s ?
|
||||
re_detail::force_newline : re_detail::dont_care);
|
||||
BOOST_REGEX_DETAIL_NS::force_newline : BOOST_REGEX_DETAIL_NS::dont_care);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -963,7 +967,7 @@ bool basic_regex_parser<charT, traits>::parse_repeat(std::size_t low, std::size_
|
||||
}
|
||||
if(0 == this->m_last_state)
|
||||
{
|
||||
fail(regex_constants::error_badrepeat, ::boost::re_detail::distance(m_base, m_position), "Nothing to repeat.");
|
||||
fail(regex_constants::error_badrepeat, ::boost::BOOST_REGEX_DETAIL_NS::distance(m_base, m_position), "Nothing to repeat.");
|
||||
return false;
|
||||
}
|
||||
if(this->m_last_state->type == syntax_element_endmark)
|
||||
@@ -1235,7 +1239,7 @@ bool basic_regex_parser<charT, traits>::parse_alt()
|
||||
//
|
||||
// we need to append a trailing jump:
|
||||
//
|
||||
re_syntax_base* pj = this->append_state(re_detail::syntax_element_jump, sizeof(re_jump));
|
||||
re_syntax_base* pj = this->append_state(BOOST_REGEX_DETAIL_NS::syntax_element_jump, sizeof(re_jump));
|
||||
std::ptrdiff_t jump_offset = this->getoffset(pj);
|
||||
//
|
||||
// now insert the alternative:
|
||||
@@ -1784,7 +1788,7 @@ charT basic_regex_parser<charT, traits>::unescape_character()
|
||||
{
|
||||
// an octal escape sequence, the first character must be a zero
|
||||
// followed by up to 3 octal digits:
|
||||
std::ptrdiff_t len = (std::min)(::boost::re_detail::distance(m_position, m_end), static_cast<std::ptrdiff_t>(4));
|
||||
std::ptrdiff_t len = (std::min)(::boost::BOOST_REGEX_DETAIL_NS::distance(m_position, m_end), static_cast<std::ptrdiff_t>(4));
|
||||
const charT* bp = m_position;
|
||||
int val = this->m_traits.toi(bp, bp + 1, 8);
|
||||
if(val != 0)
|
||||
@@ -2521,7 +2525,7 @@ option_group_jump:
|
||||
// Rewind to start of (? sequence:
|
||||
--m_position;
|
||||
while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_mark) --m_position;
|
||||
this->fail(regex_constants::error_paren, ::boost::re_detail::distance(m_base, m_end));
|
||||
this->fail(regex_constants::error_paren, ::boost::BOOST_REGEX_DETAIL_NS::distance(m_base, m_end));
|
||||
return false;
|
||||
}
|
||||
BOOST_ASSERT(this->m_traits.syntax_type(*m_position) == regex_constants::syntax_close_mark);
|
||||
@@ -2652,6 +2656,194 @@ option_group_jump:
|
||||
return true;
|
||||
}
|
||||
|
||||
template <class charT, class traits>
|
||||
bool basic_regex_parser<charT, traits>::match_verb(const char* verb)
|
||||
{
|
||||
while(*verb)
|
||||
{
|
||||
if(static_cast<charT>(*verb) != *m_position)
|
||||
{
|
||||
while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_mark) --m_position;
|
||||
fail(regex_constants::error_perl_extension, m_position - m_base);
|
||||
return false;
|
||||
}
|
||||
if(++m_position == m_end)
|
||||
{
|
||||
--m_position;
|
||||
while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_mark) --m_position;
|
||||
fail(regex_constants::error_perl_extension, m_position - m_base);
|
||||
return false;
|
||||
}
|
||||
++verb;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
template <class charT, class traits>
|
||||
bool basic_regex_parser<charT, traits>::parse_perl_verb()
|
||||
{
|
||||
if(++m_position == m_end)
|
||||
{
|
||||
// Rewind to start of (* sequence:
|
||||
--m_position;
|
||||
while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_mark) --m_position;
|
||||
fail(regex_constants::error_perl_extension, m_position - m_base);
|
||||
return false;
|
||||
}
|
||||
switch(*m_position)
|
||||
{
|
||||
case 'F':
|
||||
if(++m_position == m_end)
|
||||
{
|
||||
// Rewind to start of (* sequence:
|
||||
--m_position;
|
||||
while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_mark) --m_position;
|
||||
fail(regex_constants::error_perl_extension, m_position - m_base);
|
||||
return false;
|
||||
}
|
||||
if((this->m_traits.syntax_type(*m_position) == regex_constants::syntax_close_mark) || match_verb("AIL"))
|
||||
{
|
||||
if((m_position == m_end) || (this->m_traits.syntax_type(*m_position) != regex_constants::syntax_close_mark))
|
||||
{
|
||||
// Rewind to start of (* sequence:
|
||||
--m_position;
|
||||
while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_mark) --m_position;
|
||||
fail(regex_constants::error_perl_extension, m_position - m_base);
|
||||
return false;
|
||||
}
|
||||
++m_position;
|
||||
this->append_state(syntax_element_fail);
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case 'A':
|
||||
if(++m_position == m_end)
|
||||
{
|
||||
// Rewind to start of (* sequence:
|
||||
--m_position;
|
||||
while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_mark) --m_position;
|
||||
fail(regex_constants::error_perl_extension, m_position - m_base);
|
||||
return false;
|
||||
}
|
||||
if(match_verb("CCEPT"))
|
||||
{
|
||||
if((m_position == m_end) || (this->m_traits.syntax_type(*m_position) != regex_constants::syntax_close_mark))
|
||||
{
|
||||
// Rewind to start of (* sequence:
|
||||
--m_position;
|
||||
while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_mark) --m_position;
|
||||
fail(regex_constants::error_perl_extension, m_position - m_base);
|
||||
return false;
|
||||
}
|
||||
++m_position;
|
||||
this->append_state(syntax_element_accept);
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case 'C':
|
||||
if(++m_position == m_end)
|
||||
{
|
||||
// Rewind to start of (* sequence:
|
||||
--m_position;
|
||||
while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_mark) --m_position;
|
||||
fail(regex_constants::error_perl_extension, m_position - m_base);
|
||||
return false;
|
||||
}
|
||||
if(match_verb("OMMIT"))
|
||||
{
|
||||
if((m_position == m_end) || (this->m_traits.syntax_type(*m_position) != regex_constants::syntax_close_mark))
|
||||
{
|
||||
// Rewind to start of (* sequence:
|
||||
--m_position;
|
||||
while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_mark) --m_position;
|
||||
fail(regex_constants::error_perl_extension, m_position - m_base);
|
||||
return false;
|
||||
}
|
||||
++m_position;
|
||||
static_cast<re_commit*>(this->append_state(syntax_element_commit, sizeof(re_commit)))->action = commit_commit;
|
||||
this->m_pdata->m_disable_match_any = true;
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case 'P':
|
||||
if(++m_position == m_end)
|
||||
{
|
||||
// Rewind to start of (* sequence:
|
||||
--m_position;
|
||||
while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_mark) --m_position;
|
||||
fail(regex_constants::error_perl_extension, m_position - m_base);
|
||||
return false;
|
||||
}
|
||||
if(match_verb("RUNE"))
|
||||
{
|
||||
if((m_position == m_end) || (this->m_traits.syntax_type(*m_position) != regex_constants::syntax_close_mark))
|
||||
{
|
||||
// Rewind to start of (* sequence:
|
||||
--m_position;
|
||||
while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_mark) --m_position;
|
||||
fail(regex_constants::error_perl_extension, m_position - m_base);
|
||||
return false;
|
||||
}
|
||||
++m_position;
|
||||
static_cast<re_commit*>(this->append_state(syntax_element_commit, sizeof(re_commit)))->action = commit_prune;
|
||||
this->m_pdata->m_disable_match_any = true;
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case 'S':
|
||||
if(++m_position == m_end)
|
||||
{
|
||||
// Rewind to start of (* sequence:
|
||||
--m_position;
|
||||
while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_mark) --m_position;
|
||||
fail(regex_constants::error_perl_extension, m_position - m_base);
|
||||
return false;
|
||||
}
|
||||
if(match_verb("KIP"))
|
||||
{
|
||||
if((m_position == m_end) || (this->m_traits.syntax_type(*m_position) != regex_constants::syntax_close_mark))
|
||||
{
|
||||
// Rewind to start of (* sequence:
|
||||
--m_position;
|
||||
while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_mark) --m_position;
|
||||
fail(regex_constants::error_perl_extension, m_position - m_base);
|
||||
return false;
|
||||
}
|
||||
++m_position;
|
||||
static_cast<re_commit*>(this->append_state(syntax_element_commit, sizeof(re_commit)))->action = commit_skip;
|
||||
this->m_pdata->m_disable_match_any = true;
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case 'T':
|
||||
if(++m_position == m_end)
|
||||
{
|
||||
// Rewind to start of (* sequence:
|
||||
--m_position;
|
||||
while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_mark) --m_position;
|
||||
fail(regex_constants::error_perl_extension, m_position - m_base);
|
||||
return false;
|
||||
}
|
||||
if(match_verb("HEN"))
|
||||
{
|
||||
if((m_position == m_end) || (this->m_traits.syntax_type(*m_position) != regex_constants::syntax_close_mark))
|
||||
{
|
||||
// Rewind to start of (* sequence:
|
||||
--m_position;
|
||||
while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_mark) --m_position;
|
||||
fail(regex_constants::error_perl_extension, m_position - m_base);
|
||||
return false;
|
||||
}
|
||||
++m_position;
|
||||
this->append_state(syntax_element_then);
|
||||
this->m_pdata->m_disable_match_any = true;
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
template <class charT, class traits>
|
||||
bool basic_regex_parser<charT, traits>::add_emacs_code(bool negate)
|
||||
{
|
||||
@@ -2862,7 +3054,7 @@ bool basic_regex_parser<charT, traits>::unwind_alts(std::ptrdiff_t last_paren_st
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
||||
} // namespace re_detail
|
||||
} // namespace BOOST_REGEX_DETAIL_NS
|
||||
} // namespace boost
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
|
||||
@@ -69,7 +69,7 @@ namespace boost{
|
||||
template <class charT>
|
||||
class cpp_regex_traits;
|
||||
|
||||
namespace re_detail{
|
||||
namespace BOOST_REGEX_DETAIL_NS{
|
||||
|
||||
//
|
||||
// class parser_buf:
|
||||
@@ -290,7 +290,7 @@ void cpp_regex_traits_char_layer<charT>::init()
|
||||
{
|
||||
std::string m("Unable to open message catalog: ");
|
||||
std::runtime_error err(m + cat_name);
|
||||
boost::re_detail::raise_runtime_error(err);
|
||||
boost::BOOST_REGEX_DETAIL_NS::raise_runtime_error(err);
|
||||
}
|
||||
}
|
||||
//
|
||||
@@ -415,8 +415,9 @@ template <class charT>
|
||||
class cpp_regex_traits_implementation : public cpp_regex_traits_char_layer<charT>
|
||||
{
|
||||
public:
|
||||
typedef typename cpp_regex_traits<charT>::char_class_type char_class_type;
|
||||
typedef typename std::ctype<charT>::mask native_mask_type;
|
||||
typedef typename cpp_regex_traits<charT>::char_class_type char_class_type;
|
||||
typedef typename std::ctype<charT>::mask native_mask_type;
|
||||
typedef typename boost::make_unsigned<native_mask_type>::type unsigned_native_mask_type;
|
||||
#ifndef BOOST_REGEX_BUGGY_CTYPE_FACET
|
||||
BOOST_STATIC_CONSTANT(char_class_type, mask_blank = 1u << 24);
|
||||
BOOST_STATIC_CONSTANT(char_class_type, mask_word = 1u << 25);
|
||||
@@ -717,7 +718,7 @@ void cpp_regex_traits_implementation<charT>::init()
|
||||
{
|
||||
std::string m("Unable to open message catalog: ");
|
||||
std::runtime_error err(m + cat_name);
|
||||
boost::re_detail::raise_runtime_error(err);
|
||||
boost::BOOST_REGEX_DETAIL_NS::raise_runtime_error(err);
|
||||
}
|
||||
}
|
||||
//
|
||||
@@ -753,19 +754,19 @@ void cpp_regex_traits_implementation<charT>::init()
|
||||
#ifndef BOOST_REGEX_BUGGY_CTYPE_FACET
|
||||
static const char_class_type masks[16] =
|
||||
{
|
||||
std::ctype<charT>::alnum,
|
||||
std::ctype<charT>::alpha,
|
||||
std::ctype<charT>::cntrl,
|
||||
std::ctype<charT>::digit,
|
||||
std::ctype<charT>::graph,
|
||||
static_cast<unsigned_native_mask_type>(std::ctype<charT>::alnum),
|
||||
static_cast<unsigned_native_mask_type>(std::ctype<charT>::alpha),
|
||||
static_cast<unsigned_native_mask_type>(std::ctype<charT>::cntrl),
|
||||
static_cast<unsigned_native_mask_type>(std::ctype<charT>::digit),
|
||||
static_cast<unsigned_native_mask_type>(std::ctype<charT>::graph),
|
||||
cpp_regex_traits_implementation<charT>::mask_horizontal,
|
||||
std::ctype<charT>::lower,
|
||||
std::ctype<charT>::print,
|
||||
std::ctype<charT>::punct,
|
||||
std::ctype<charT>::space,
|
||||
std::ctype<charT>::upper,
|
||||
static_cast<unsigned_native_mask_type>(std::ctype<charT>::lower),
|
||||
static_cast<unsigned_native_mask_type>(std::ctype<charT>::print),
|
||||
static_cast<unsigned_native_mask_type>(std::ctype<charT>::punct),
|
||||
static_cast<unsigned_native_mask_type>(std::ctype<charT>::space),
|
||||
static_cast<unsigned_native_mask_type>(std::ctype<charT>::upper),
|
||||
cpp_regex_traits_implementation<charT>::mask_vertical,
|
||||
std::ctype<charT>::xdigit,
|
||||
static_cast<unsigned_native_mask_type>(std::ctype<charT>::xdigit),
|
||||
cpp_regex_traits_implementation<charT>::mask_blank,
|
||||
cpp_regex_traits_implementation<charT>::mask_word,
|
||||
cpp_regex_traits_implementation<charT>::mask_unicode,
|
||||
@@ -773,22 +774,22 @@ void cpp_regex_traits_implementation<charT>::init()
|
||||
#else
|
||||
static const char_class_type masks[16] =
|
||||
{
|
||||
::boost::re_detail::char_class_alnum,
|
||||
::boost::re_detail::char_class_alpha,
|
||||
::boost::re_detail::char_class_cntrl,
|
||||
::boost::re_detail::char_class_digit,
|
||||
::boost::re_detail::char_class_graph,
|
||||
::boost::re_detail::char_class_horizontal_space,
|
||||
::boost::re_detail::char_class_lower,
|
||||
::boost::re_detail::char_class_print,
|
||||
::boost::re_detail::char_class_punct,
|
||||
::boost::re_detail::char_class_space,
|
||||
::boost::re_detail::char_class_upper,
|
||||
::boost::re_detail::char_class_vertical_space,
|
||||
::boost::re_detail::char_class_xdigit,
|
||||
::boost::re_detail::char_class_blank,
|
||||
::boost::re_detail::char_class_word,
|
||||
::boost::re_detail::char_class_unicode,
|
||||
::boost::BOOST_REGEX_DETAIL_NS::char_class_alnum,
|
||||
::boost::BOOST_REGEX_DETAIL_NS::char_class_alpha,
|
||||
::boost::BOOST_REGEX_DETAIL_NS::char_class_cntrl,
|
||||
::boost::BOOST_REGEX_DETAIL_NS::char_class_digit,
|
||||
::boost::BOOST_REGEX_DETAIL_NS::char_class_graph,
|
||||
::boost::BOOST_REGEX_DETAIL_NS::char_class_horizontal_space,
|
||||
::boost::BOOST_REGEX_DETAIL_NS::char_class_lower,
|
||||
::boost::BOOST_REGEX_DETAIL_NS::char_class_print,
|
||||
::boost::BOOST_REGEX_DETAIL_NS::char_class_punct,
|
||||
::boost::BOOST_REGEX_DETAIL_NS::char_class_space,
|
||||
::boost::BOOST_REGEX_DETAIL_NS::char_class_upper,
|
||||
::boost::BOOST_REGEX_DETAIL_NS::char_class_vertical_space,
|
||||
::boost::BOOST_REGEX_DETAIL_NS::char_class_xdigit,
|
||||
::boost::BOOST_REGEX_DETAIL_NS::char_class_blank,
|
||||
::boost::BOOST_REGEX_DETAIL_NS::char_class_word,
|
||||
::boost::BOOST_REGEX_DETAIL_NS::char_class_unicode,
|
||||
};
|
||||
#endif
|
||||
static const string_type null_string;
|
||||
@@ -803,7 +804,7 @@ void cpp_regex_traits_implementation<charT>::init()
|
||||
//
|
||||
// get the collation format used by m_pcollate:
|
||||
//
|
||||
m_collate_type = re_detail::find_sort_syntax(this, &m_collate_delim);
|
||||
m_collate_type = BOOST_REGEX_DETAIL_NS::find_sort_syntax(this, &m_collate_delim);
|
||||
}
|
||||
|
||||
template <class charT>
|
||||
@@ -814,53 +815,53 @@ typename cpp_regex_traits_implementation<charT>::char_class_type
|
||||
static const char_class_type masks[22] =
|
||||
{
|
||||
0,
|
||||
std::ctype<char>::alnum,
|
||||
std::ctype<char>::alpha,
|
||||
static_cast<unsigned_native_mask_type>(std::ctype<char>::alnum),
|
||||
static_cast<unsigned_native_mask_type>(std::ctype<char>::alpha),
|
||||
cpp_regex_traits_implementation<charT>::mask_blank,
|
||||
std::ctype<char>::cntrl,
|
||||
std::ctype<char>::digit,
|
||||
std::ctype<char>::digit,
|
||||
std::ctype<char>::graph,
|
||||
static_cast<unsigned_native_mask_type>(std::ctype<char>::cntrl),
|
||||
static_cast<unsigned_native_mask_type>(std::ctype<char>::digit),
|
||||
static_cast<unsigned_native_mask_type>(std::ctype<char>::digit),
|
||||
static_cast<unsigned_native_mask_type>(std::ctype<char>::graph),
|
||||
cpp_regex_traits_implementation<charT>::mask_horizontal,
|
||||
std::ctype<char>::lower,
|
||||
std::ctype<char>::lower,
|
||||
std::ctype<char>::print,
|
||||
std::ctype<char>::punct,
|
||||
std::ctype<char>::space,
|
||||
std::ctype<char>::space,
|
||||
std::ctype<char>::upper,
|
||||
static_cast<unsigned_native_mask_type>(std::ctype<char>::lower),
|
||||
static_cast<unsigned_native_mask_type>(std::ctype<char>::lower),
|
||||
static_cast<unsigned_native_mask_type>(std::ctype<char>::print),
|
||||
static_cast<unsigned_native_mask_type>(std::ctype<char>::punct),
|
||||
static_cast<unsigned_native_mask_type>(std::ctype<char>::space),
|
||||
static_cast<unsigned_native_mask_type>(std::ctype<char>::space),
|
||||
static_cast<unsigned_native_mask_type>(std::ctype<char>::upper),
|
||||
cpp_regex_traits_implementation<charT>::mask_unicode,
|
||||
std::ctype<char>::upper,
|
||||
static_cast<unsigned_native_mask_type>(std::ctype<char>::upper),
|
||||
cpp_regex_traits_implementation<charT>::mask_vertical,
|
||||
std::ctype<char>::alnum | cpp_regex_traits_implementation<charT>::mask_word,
|
||||
std::ctype<char>::alnum | cpp_regex_traits_implementation<charT>::mask_word,
|
||||
std::ctype<char>::xdigit,
|
||||
static_cast<unsigned_native_mask_type>(std::ctype<char>::alnum) | cpp_regex_traits_implementation<charT>::mask_word,
|
||||
static_cast<unsigned_native_mask_type>(std::ctype<char>::alnum) | cpp_regex_traits_implementation<charT>::mask_word,
|
||||
static_cast<unsigned_native_mask_type>(std::ctype<char>::xdigit),
|
||||
};
|
||||
#else
|
||||
static const char_class_type masks[22] =
|
||||
{
|
||||
0,
|
||||
::boost::re_detail::char_class_alnum,
|
||||
::boost::re_detail::char_class_alpha,
|
||||
::boost::re_detail::char_class_blank,
|
||||
::boost::re_detail::char_class_cntrl,
|
||||
::boost::re_detail::char_class_digit,
|
||||
::boost::re_detail::char_class_digit,
|
||||
::boost::re_detail::char_class_graph,
|
||||
::boost::re_detail::char_class_horizontal_space,
|
||||
::boost::re_detail::char_class_lower,
|
||||
::boost::re_detail::char_class_lower,
|
||||
::boost::re_detail::char_class_print,
|
||||
::boost::re_detail::char_class_punct,
|
||||
::boost::re_detail::char_class_space,
|
||||
::boost::re_detail::char_class_space,
|
||||
::boost::re_detail::char_class_upper,
|
||||
::boost::re_detail::char_class_unicode,
|
||||
::boost::re_detail::char_class_upper,
|
||||
::boost::re_detail::char_class_vertical_space,
|
||||
::boost::re_detail::char_class_alnum | ::boost::re_detail::char_class_word,
|
||||
::boost::re_detail::char_class_alnum | ::boost::re_detail::char_class_word,
|
||||
::boost::re_detail::char_class_xdigit,
|
||||
::boost::BOOST_REGEX_DETAIL_NS::char_class_alnum,
|
||||
::boost::BOOST_REGEX_DETAIL_NS::char_class_alpha,
|
||||
::boost::BOOST_REGEX_DETAIL_NS::char_class_blank,
|
||||
::boost::BOOST_REGEX_DETAIL_NS::char_class_cntrl,
|
||||
::boost::BOOST_REGEX_DETAIL_NS::char_class_digit,
|
||||
::boost::BOOST_REGEX_DETAIL_NS::char_class_digit,
|
||||
::boost::BOOST_REGEX_DETAIL_NS::char_class_graph,
|
||||
::boost::BOOST_REGEX_DETAIL_NS::char_class_horizontal_space,
|
||||
::boost::BOOST_REGEX_DETAIL_NS::char_class_lower,
|
||||
::boost::BOOST_REGEX_DETAIL_NS::char_class_lower,
|
||||
::boost::BOOST_REGEX_DETAIL_NS::char_class_print,
|
||||
::boost::BOOST_REGEX_DETAIL_NS::char_class_punct,
|
||||
::boost::BOOST_REGEX_DETAIL_NS::char_class_space,
|
||||
::boost::BOOST_REGEX_DETAIL_NS::char_class_space,
|
||||
::boost::BOOST_REGEX_DETAIL_NS::char_class_upper,
|
||||
::boost::BOOST_REGEX_DETAIL_NS::char_class_unicode,
|
||||
::boost::BOOST_REGEX_DETAIL_NS::char_class_upper,
|
||||
::boost::BOOST_REGEX_DETAIL_NS::char_class_vertical_space,
|
||||
::boost::BOOST_REGEX_DETAIL_NS::char_class_alnum | ::boost::BOOST_REGEX_DETAIL_NS::char_class_word,
|
||||
::boost::BOOST_REGEX_DETAIL_NS::char_class_alnum | ::boost::BOOST_REGEX_DETAIL_NS::char_class_word,
|
||||
::boost::BOOST_REGEX_DETAIL_NS::char_class_xdigit,
|
||||
};
|
||||
#endif
|
||||
if(m_custom_class_names.size())
|
||||
@@ -870,7 +871,7 @@ typename cpp_regex_traits_implementation<charT>::char_class_type
|
||||
if(pos != m_custom_class_names.end())
|
||||
return pos->second;
|
||||
}
|
||||
std::size_t state_id = 1 + re_detail::get_default_class_id(p1, p2);
|
||||
std::size_t state_id = 1 + BOOST_REGEX_DETAIL_NS::get_default_class_id(p1, p2);
|
||||
BOOST_ASSERT(state_id < sizeof(masks) / sizeof(masks[0]));
|
||||
return masks[state_id];
|
||||
}
|
||||
@@ -880,20 +881,20 @@ template <class charT>
|
||||
bool cpp_regex_traits_implementation<charT>::isctype(const charT c, char_class_type mask) const
|
||||
{
|
||||
return
|
||||
((mask & ::boost::re_detail::char_class_space) && (this->m_pctype->is(std::ctype<charT>::space, c)))
|
||||
|| ((mask & ::boost::re_detail::char_class_print) && (this->m_pctype->is(std::ctype<charT>::print, c)))
|
||||
|| ((mask & ::boost::re_detail::char_class_cntrl) && (this->m_pctype->is(std::ctype<charT>::cntrl, c)))
|
||||
|| ((mask & ::boost::re_detail::char_class_upper) && (this->m_pctype->is(std::ctype<charT>::upper, c)))
|
||||
|| ((mask & ::boost::re_detail::char_class_lower) && (this->m_pctype->is(std::ctype<charT>::lower, c)))
|
||||
|| ((mask & ::boost::re_detail::char_class_alpha) && (this->m_pctype->is(std::ctype<charT>::alpha, c)))
|
||||
|| ((mask & ::boost::re_detail::char_class_digit) && (this->m_pctype->is(std::ctype<charT>::digit, c)))
|
||||
|| ((mask & ::boost::re_detail::char_class_punct) && (this->m_pctype->is(std::ctype<charT>::punct, c)))
|
||||
|| ((mask & ::boost::re_detail::char_class_xdigit) && (this->m_pctype->is(std::ctype<charT>::xdigit, c)))
|
||||
|| ((mask & ::boost::re_detail::char_class_blank) && (this->m_pctype->is(std::ctype<charT>::space, c)) && !::boost::re_detail::is_separator(c))
|
||||
|| ((mask & ::boost::re_detail::char_class_word) && (c == '_'))
|
||||
|| ((mask & ::boost::re_detail::char_class_unicode) && ::boost::re_detail::is_extended(c))
|
||||
|| ((mask & ::boost::re_detail::char_class_vertical_space) && (is_separator(c) || (c == '\v')))
|
||||
|| ((mask & ::boost::re_detail::char_class_horizontal_space) && this->m_pctype->is(std::ctype<charT>::space, c) && !(is_separator(c) || (c == '\v')));
|
||||
((mask & ::boost::BOOST_REGEX_DETAIL_NS::char_class_space) && (this->m_pctype->is(std::ctype<charT>::space, c)))
|
||||
|| ((mask & ::boost::BOOST_REGEX_DETAIL_NS::char_class_print) && (this->m_pctype->is(std::ctype<charT>::print, c)))
|
||||
|| ((mask & ::boost::BOOST_REGEX_DETAIL_NS::char_class_cntrl) && (this->m_pctype->is(std::ctype<charT>::cntrl, c)))
|
||||
|| ((mask & ::boost::BOOST_REGEX_DETAIL_NS::char_class_upper) && (this->m_pctype->is(std::ctype<charT>::upper, c)))
|
||||
|| ((mask & ::boost::BOOST_REGEX_DETAIL_NS::char_class_lower) && (this->m_pctype->is(std::ctype<charT>::lower, c)))
|
||||
|| ((mask & ::boost::BOOST_REGEX_DETAIL_NS::char_class_alpha) && (this->m_pctype->is(std::ctype<charT>::alpha, c)))
|
||||
|| ((mask & ::boost::BOOST_REGEX_DETAIL_NS::char_class_digit) && (this->m_pctype->is(std::ctype<charT>::digit, c)))
|
||||
|| ((mask & ::boost::BOOST_REGEX_DETAIL_NS::char_class_punct) && (this->m_pctype->is(std::ctype<charT>::punct, c)))
|
||||
|| ((mask & ::boost::BOOST_REGEX_DETAIL_NS::char_class_xdigit) && (this->m_pctype->is(std::ctype<charT>::xdigit, c)))
|
||||
|| ((mask & ::boost::BOOST_REGEX_DETAIL_NS::char_class_blank) && (this->m_pctype->is(std::ctype<charT>::space, c)) && !::boost::BOOST_REGEX_DETAIL_NS::is_separator(c))
|
||||
|| ((mask & ::boost::BOOST_REGEX_DETAIL_NS::char_class_word) && (c == '_'))
|
||||
|| ((mask & ::boost::BOOST_REGEX_DETAIL_NS::char_class_unicode) && ::boost::BOOST_REGEX_DETAIL_NS::is_extended(c))
|
||||
|| ((mask & ::boost::BOOST_REGEX_DETAIL_NS::char_class_vertical_space) && (is_separator(c) || (c == '\v')))
|
||||
|| ((mask & ::boost::BOOST_REGEX_DETAIL_NS::char_class_horizontal_space) && this->m_pctype->is(std::ctype<charT>::space, c) && !(is_separator(c) || (c == '\v')));
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -905,7 +906,7 @@ inline boost::shared_ptr<const cpp_regex_traits_implementation<charT> > create_c
|
||||
return ::boost::object_cache<cpp_regex_traits_base<charT>, cpp_regex_traits_implementation<charT> >::get(key, 5);
|
||||
}
|
||||
|
||||
} // re_detail
|
||||
} // BOOST_REGEX_DETAIL_NS
|
||||
|
||||
template <class charT>
|
||||
class cpp_regex_traits
|
||||
@@ -922,7 +923,7 @@ public:
|
||||
struct boost_extensions_tag{};
|
||||
|
||||
cpp_regex_traits()
|
||||
: m_pimpl(re_detail::create_cpp_regex_traits<charT>(std::locale()))
|
||||
: m_pimpl(BOOST_REGEX_DETAIL_NS::create_cpp_regex_traits<charT>(std::locale()))
|
||||
{ }
|
||||
static size_type length(const char_type* p)
|
||||
{
|
||||
@@ -995,20 +996,32 @@ public:
|
||||
&& (m_pimpl->m_pctype->is(
|
||||
static_cast<ctype_mask>(f & mask_base), c)))
|
||||
return true;
|
||||
else if((f & re_detail::cpp_regex_traits_implementation<charT>::mask_unicode) && re_detail::is_extended(c))
|
||||
else if((f & BOOST_REGEX_DETAIL_NS::cpp_regex_traits_implementation<charT>::mask_unicode) && BOOST_REGEX_DETAIL_NS::is_extended(c))
|
||||
return true;
|
||||
else if((f & re_detail::cpp_regex_traits_implementation<charT>::mask_word) && (c == '_'))
|
||||
else if((f & BOOST_REGEX_DETAIL_NS::cpp_regex_traits_implementation<charT>::mask_word) && (c == '_'))
|
||||
return true;
|
||||
else if((f & re_detail::cpp_regex_traits_implementation<charT>::mask_blank)
|
||||
else if((f & BOOST_REGEX_DETAIL_NS::cpp_regex_traits_implementation<charT>::mask_blank)
|
||||
&& m_pimpl->m_pctype->is(std::ctype<charT>::space, c)
|
||||
&& !re_detail::is_separator(c))
|
||||
&& !BOOST_REGEX_DETAIL_NS::is_separator(c))
|
||||
return true;
|
||||
else if((f & re_detail::cpp_regex_traits_implementation<charT>::mask_vertical)
|
||||
&& (::boost::re_detail::is_separator(c) || (c == '\v')))
|
||||
else if((f & BOOST_REGEX_DETAIL_NS::cpp_regex_traits_implementation<charT>::mask_vertical)
|
||||
&& (::boost::BOOST_REGEX_DETAIL_NS::is_separator(c) || (c == '\v')))
|
||||
return true;
|
||||
else if((f & re_detail::cpp_regex_traits_implementation<charT>::mask_horizontal)
|
||||
&& this->isctype(c, std::ctype<charT>::space) && !this->isctype(c, re_detail::cpp_regex_traits_implementation<charT>::mask_vertical))
|
||||
else if((f & BOOST_REGEX_DETAIL_NS::cpp_regex_traits_implementation<charT>::mask_horizontal)
|
||||
&& this->isctype(c, std::ctype<charT>::space) && !this->isctype(c, BOOST_REGEX_DETAIL_NS::cpp_regex_traits_implementation<charT>::mask_vertical))
|
||||
return true;
|
||||
#ifdef __CYGWIN__
|
||||
//
|
||||
// Cygwin has a buggy ctype facet, see https://www.cygwin.com/ml/cygwin/2012-08/msg00178.html:
|
||||
//
|
||||
else if((f & std::ctype<charT>::xdigit) == std::ctype<charT>::xdigit)
|
||||
{
|
||||
if((c >= 'a') && (c <= 'f'))
|
||||
return true;
|
||||
if((c >= 'A') && (c <= 'F'))
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
return false;
|
||||
#else
|
||||
return m_pimpl->isctype(c, f);
|
||||
@@ -1023,7 +1036,7 @@ public:
|
||||
locale_type imbue(locale_type l)
|
||||
{
|
||||
std::locale result(getloc());
|
||||
m_pimpl = re_detail::create_cpp_regex_traits<charT>(l);
|
||||
m_pimpl = BOOST_REGEX_DETAIL_NS::create_cpp_regex_traits<charT>(l);
|
||||
return result;
|
||||
}
|
||||
locale_type getloc()const
|
||||
@@ -1043,7 +1056,7 @@ public:
|
||||
static std::string get_catalog_name();
|
||||
|
||||
private:
|
||||
boost::shared_ptr<const re_detail::cpp_regex_traits_implementation<charT> > m_pimpl;
|
||||
boost::shared_ptr<const BOOST_REGEX_DETAIL_NS::cpp_regex_traits_implementation<charT> > m_pimpl;
|
||||
//
|
||||
// catalog name handler:
|
||||
//
|
||||
@@ -1058,7 +1071,7 @@ private:
|
||||
template <class charT>
|
||||
int cpp_regex_traits<charT>::toi(const charT*& first, const charT* last, int radix)const
|
||||
{
|
||||
re_detail::parser_buf<charT> sbuf; // buffer for parsing numbers.
|
||||
BOOST_REGEX_DETAIL_NS::parser_buf<charT> sbuf; // buffer for parsing numbers.
|
||||
std::basic_istream<charT> is(&sbuf); // stream for parsing numbers.
|
||||
|
||||
// we do NOT want to parse any thousands separators inside the stream:
|
||||
|
||||
@@ -221,7 +221,7 @@ namespace boost{
|
||||
|
||||
class RegEx;
|
||||
|
||||
namespace re_detail{
|
||||
namespace BOOST_REGEX_DETAIL_NS{
|
||||
|
||||
class RegExData;
|
||||
struct pred1;
|
||||
@@ -229,7 +229,7 @@ struct pred2;
|
||||
struct pred3;
|
||||
struct pred4;
|
||||
|
||||
} /* namespace re_detail */
|
||||
} /* namespace BOOST_REGEX_DETAIL_NS */
|
||||
|
||||
#if (defined(BOOST_MSVC) || defined(__BORLANDC__)) && !defined(BOOST_DISABLE_WIN32)
|
||||
typedef bool (__cdecl *GrepCallback)(const RegEx& expression);
|
||||
@@ -244,7 +244,7 @@ typedef bool (*FindFilesCallback)(const char* file);
|
||||
class BOOST_REGEX_DECL RegEx
|
||||
{
|
||||
private:
|
||||
re_detail::RegExData* pdata;
|
||||
BOOST_REGEX_DETAIL_NS::RegExData* pdata;
|
||||
public:
|
||||
RegEx();
|
||||
RegEx(const RegEx& o);
|
||||
@@ -296,10 +296,10 @@ public:
|
||||
|
||||
static const std::size_t npos;
|
||||
|
||||
friend struct re_detail::pred1;
|
||||
friend struct re_detail::pred2;
|
||||
friend struct re_detail::pred3;
|
||||
friend struct re_detail::pred4;
|
||||
friend struct BOOST_REGEX_DETAIL_NS::pred1;
|
||||
friend struct BOOST_REGEX_DETAIL_NS::pred2;
|
||||
friend struct BOOST_REGEX_DETAIL_NS::pred3;
|
||||
friend struct BOOST_REGEX_DETAIL_NS::pred4;
|
||||
};
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
#include <cstddef>
|
||||
|
||||
namespace boost{
|
||||
namespace re_detail{
|
||||
namespace BOOST_REGEX_DETAIL_NS{
|
||||
|
||||
#ifndef BOOST_NO_ANSI_APIS
|
||||
typedef WIN32_FIND_DATAA _fi_find_data;
|
||||
@@ -58,7 +58,7 @@ typedef WIN32_FIND_DATAW _fi_find_data;
|
||||
#endif
|
||||
typedef HANDLE _fi_find_handle;
|
||||
|
||||
} // namespace re_detail
|
||||
} // namespace BOOST_REGEX_DETAIL_NS
|
||||
|
||||
} // namespace boost
|
||||
|
||||
@@ -84,7 +84,7 @@ using std::list;
|
||||
#endif
|
||||
|
||||
namespace boost{
|
||||
namespace re_detail{
|
||||
namespace BOOST_REGEX_DETAIL_NS{
|
||||
|
||||
#ifdef BOOST_HAS_ABI_HEADERS
|
||||
# include BOOST_ABI_PREFIX
|
||||
@@ -110,7 +110,7 @@ bool _fi_FindClose(_fi_find_handle hFindFile);
|
||||
# include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
} // namespace re_detail
|
||||
} // namespace BOOST_REGEX_DETAIL_NS
|
||||
} // namespace boost
|
||||
|
||||
#ifdef FindFirstFile
|
||||
@@ -130,7 +130,7 @@ bool _fi_FindClose(_fi_find_handle hFindFile);
|
||||
#endif
|
||||
|
||||
namespace boost{
|
||||
namespace re_detail{
|
||||
namespace BOOST_REGEX_DETAIL_NS{
|
||||
|
||||
#ifdef BOOST_HAS_ABI_HEADERS
|
||||
# include BOOST_ABI_PREFIX
|
||||
@@ -427,10 +427,10 @@ inline bool operator < (const directory_iterator&, const directory_iterator&)
|
||||
#endif
|
||||
|
||||
|
||||
} // namespace re_detail
|
||||
using boost::re_detail::directory_iterator;
|
||||
using boost::re_detail::file_iterator;
|
||||
using boost::re_detail::mapfile;
|
||||
} // namespace BOOST_REGEX_DETAIL_NS
|
||||
using boost::BOOST_REGEX_DETAIL_NS::directory_iterator;
|
||||
using boost::BOOST_REGEX_DETAIL_NS::file_iterator;
|
||||
using boost::BOOST_REGEX_DETAIL_NS::mapfile;
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_REGEX_NO_FILEITER
|
||||
|
||||
@@ -54,7 +54,7 @@ namespace boost{
|
||||
template class BOOST_REGEX_DECL basic_regex< BOOST_REGEX_CHAR_T BOOST_REGEX_TRAITS_T >;
|
||||
template class BOOST_REGEX_DECL match_results< const BOOST_REGEX_CHAR_T* >;
|
||||
#ifndef BOOST_NO_STD_ALLOCATOR
|
||||
template class BOOST_REGEX_DECL ::boost::re_detail::perl_matcher<BOOST_REGEX_CHAR_T const *, match_results< const BOOST_REGEX_CHAR_T* >::allocator_type BOOST_REGEX_TRAITS_T >;
|
||||
template class BOOST_REGEX_DECL ::boost::BOOST_REGEX_DETAIL_NS::perl_matcher<BOOST_REGEX_CHAR_T const *, match_results< const BOOST_REGEX_CHAR_T* >::allocator_type BOOST_REGEX_TRAITS_T >;
|
||||
#endif
|
||||
|
||||
# ifndef BOOST_REGEX_INSTANTIATE
|
||||
@@ -94,7 +94,7 @@ template class BOOST_REGEX_TEMPLATE_DECL basic_regex< BOOST_REGEX_CHAR_T BOOST_R
|
||||
|
||||
template class BOOST_REGEX_TEMPLATE_DECL match_results< const BOOST_REGEX_CHAR_T* >;
|
||||
#ifndef BOOST_NO_STD_ALLOCATOR
|
||||
template class BOOST_REGEX_TEMPLATE_DECL ::boost::re_detail::perl_matcher<BOOST_REGEX_CHAR_T const *, match_results< const BOOST_REGEX_CHAR_T* >::allocator_type BOOST_REGEX_TRAITS_T >;
|
||||
template class BOOST_REGEX_TEMPLATE_DECL ::boost::BOOST_REGEX_DETAIL_NS::perl_matcher<BOOST_REGEX_CHAR_T const *, match_results< const BOOST_REGEX_CHAR_T* >::allocator_type BOOST_REGEX_TRAITS_T >;
|
||||
#endif
|
||||
#if !(defined(BOOST_DINKUMWARE_STDLIB) && (BOOST_DINKUMWARE_STDLIB <= 1))\
|
||||
&& !(defined(BOOST_INTEL_CXX_VERSION) && (BOOST_INTEL_CXX_VERSION <= 800))\
|
||||
@@ -102,7 +102,7 @@ template class BOOST_REGEX_TEMPLATE_DECL ::boost::re_detail::perl_matcher<BOOST_
|
||||
&& !defined(BOOST_REGEX_ICU_INSTANCES)
|
||||
template class BOOST_REGEX_TEMPLATE_DECL match_results< std::basic_string<BOOST_REGEX_CHAR_T>::const_iterator >;
|
||||
#ifndef BOOST_NO_STD_ALLOCATOR
|
||||
template class BOOST_REGEX_TEMPLATE_DECL ::boost::re_detail::perl_matcher< std::basic_string<BOOST_REGEX_CHAR_T>::const_iterator, match_results< std::basic_string<BOOST_REGEX_CHAR_T>::const_iterator >::allocator_type, boost::regex_traits<BOOST_REGEX_CHAR_T > >;
|
||||
template class BOOST_REGEX_TEMPLATE_DECL ::boost::BOOST_REGEX_DETAIL_NS::perl_matcher< std::basic_string<BOOST_REGEX_CHAR_T>::const_iterator, match_results< std::basic_string<BOOST_REGEX_CHAR_T>::const_iterator >::allocator_type, boost::regex_traits<BOOST_REGEX_CHAR_T > >;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -119,6 +119,11 @@ template class BOOST_REGEX_TEMPLATE_DECL ::boost::re_detail::perl_matcher< std::
|
||||
|
||||
#elif (defined(__GNUC__) && (__GNUC__ >= 3)) || !defined(BOOST_NO_CXX11_EXTERN_TEMPLATE)
|
||||
|
||||
#ifdef __clang__
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wkeyword-macro"
|
||||
#endif
|
||||
|
||||
# ifndef BOOST_REGEX_INSTANTIATE
|
||||
# ifdef __GNUC__
|
||||
# define template __extension__ extern template
|
||||
@@ -128,7 +133,7 @@ template class BOOST_REGEX_TEMPLATE_DECL ::boost::re_detail::perl_matcher< std::
|
||||
# endif
|
||||
|
||||
#if !defined(BOOST_NO_STD_LOCALE) && !defined(BOOST_REGEX_ICU_INSTANCES)
|
||||
namespace re_detail{
|
||||
namespace BOOST_REGEX_DETAIL_NS{
|
||||
template BOOST_REGEX_DECL
|
||||
std::locale cpp_regex_traits_base<BOOST_REGEX_CHAR_T>::imbue(const std::locale& l);
|
||||
|
||||
@@ -177,7 +182,7 @@ template BOOST_REGEX_DECL void BOOST_REGEX_CALL
|
||||
match_results<const BOOST_REGEX_CHAR_T*>::maybe_assign(
|
||||
const match_results<const BOOST_REGEX_CHAR_T*>& m);
|
||||
|
||||
namespace re_detail{
|
||||
namespace BOOST_REGEX_DETAIL_NS{
|
||||
template BOOST_REGEX_DECL void perl_matcher<BOOST_REGEX_CHAR_T const *, match_results< const BOOST_REGEX_CHAR_T* >::allocator_type BOOST_REGEX_TRAITS_T >::construct_init(
|
||||
const basic_regex<BOOST_REGEX_CHAR_T BOOST_REGEX_TRAITS_T >& e, match_flag_type f);
|
||||
template BOOST_REGEX_DECL bool perl_matcher<BOOST_REGEX_CHAR_T const *, match_results< const BOOST_REGEX_CHAR_T* >::allocator_type BOOST_REGEX_TRAITS_T >::match();
|
||||
@@ -193,7 +198,7 @@ template BOOST_REGEX_DECL void BOOST_REGEX_CALL
|
||||
match_results<std::basic_string<BOOST_REGEX_CHAR_T>::const_iterator>::maybe_assign(
|
||||
const match_results<std::basic_string<BOOST_REGEX_CHAR_T>::const_iterator>& m);
|
||||
|
||||
namespace re_detail{
|
||||
namespace BOOST_REGEX_DETAIL_NS{
|
||||
template BOOST_REGEX_DECL void perl_matcher<std::basic_string<BOOST_REGEX_CHAR_T>::const_iterator, match_results< std::basic_string<BOOST_REGEX_CHAR_T>::const_iterator >::allocator_type, boost::regex_traits<BOOST_REGEX_CHAR_T > >::construct_init(
|
||||
const basic_regex<BOOST_REGEX_CHAR_T>& e, match_flag_type f);
|
||||
template BOOST_REGEX_DECL bool perl_matcher<std::basic_string<BOOST_REGEX_CHAR_T>::const_iterator, match_results< std::basic_string<BOOST_REGEX_CHAR_T>::const_iterator >::allocator_type, boost::regex_traits<BOOST_REGEX_CHAR_T > >::match();
|
||||
@@ -205,7 +210,9 @@ template BOOST_REGEX_DECL bool perl_matcher<std::basic_string<BOOST_REGEX_CHAR_T
|
||||
# undef template
|
||||
# endif
|
||||
|
||||
|
||||
#ifdef __clang__
|
||||
#pragma clang diagnostic pop
|
||||
#endif
|
||||
#endif
|
||||
|
||||
} // namespace boost
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
#endif
|
||||
|
||||
namespace boost{
|
||||
namespace re_detail{
|
||||
namespace BOOST_REGEX_DETAIL_NS{
|
||||
|
||||
#if defined(BOOST_NO_STD_ITERATOR_TRAITS)
|
||||
|
||||
@@ -117,7 +117,7 @@ struct regex_iterator_traits : public std::iterator_traits<T> {};
|
||||
|
||||
#endif
|
||||
|
||||
} // namespace re_detail
|
||||
} // namespace BOOST_REGEX_DETAIL_NS
|
||||
} // namespace boost
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace boost{
|
||||
# endif
|
||||
#endif
|
||||
|
||||
namespace re_detail{
|
||||
namespace BOOST_REGEX_DETAIL_NS{
|
||||
|
||||
class named_subexpressions;
|
||||
|
||||
@@ -64,14 +64,14 @@ public:
|
||||
typedef const_reference reference;
|
||||
typedef typename vector_type::const_iterator const_iterator;
|
||||
typedef const_iterator iterator;
|
||||
typedef typename re_detail::regex_iterator_traits<
|
||||
typedef typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<
|
||||
BidiIterator>::difference_type difference_type;
|
||||
typedef typename Allocator::size_type size_type;
|
||||
typedef Allocator allocator_type;
|
||||
typedef typename re_detail::regex_iterator_traits<
|
||||
typedef typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<
|
||||
BidiIterator>::value_type char_type;
|
||||
typedef std::basic_string<char_type> string_type;
|
||||
typedef re_detail::named_subexpressions named_sub_type;
|
||||
typedef BOOST_REGEX_DETAIL_NS::named_subexpressions named_sub_type;
|
||||
|
||||
// construct/copy/destroy:
|
||||
explicit match_results(const Allocator& a = Allocator())
|
||||
@@ -158,7 +158,7 @@ public:
|
||||
const sub_match<BidiIterator>& s = m_subs[sub];
|
||||
if(s.matched || (sub == 2))
|
||||
{
|
||||
return ::boost::re_detail::distance((BidiIterator)(m_base), (BidiIterator)(s.first));
|
||||
return ::boost::BOOST_REGEX_DETAIL_NS::distance((BidiIterator)(m_base), (BidiIterator)(s.first));
|
||||
}
|
||||
}
|
||||
return ~static_cast<difference_type>(0);
|
||||
@@ -237,7 +237,7 @@ public:
|
||||
//
|
||||
if(m_is_singular)
|
||||
raise_logic_error();
|
||||
re_detail::named_subexpressions::range_type r = m_named_subs->equal_range(i, j);
|
||||
BOOST_REGEX_DETAIL_NS::named_subexpressions::range_type r = m_named_subs->equal_range(i, j);
|
||||
while((r.first != r.second) && ((*this)[r.first->index].matched == false))
|
||||
++r.first;
|
||||
return r.first != r.second ? (*this)[r.first->index] : m_null;
|
||||
@@ -262,7 +262,7 @@ public:
|
||||
//
|
||||
if(m_is_singular)
|
||||
raise_logic_error();
|
||||
re_detail::named_subexpressions::range_type s, r;
|
||||
BOOST_REGEX_DETAIL_NS::named_subexpressions::range_type s, r;
|
||||
s = r = m_named_subs->equal_range(i, j);
|
||||
while((r.first != r.second) && ((*this)[r.first->index].matched == false))
|
||||
++r.first;
|
||||
@@ -345,7 +345,7 @@ public:
|
||||
{
|
||||
if(m_is_singular)
|
||||
raise_logic_error();
|
||||
typedef typename re_detail::compute_functor_type<Functor, match_results<BidiIterator, Allocator>, OutputIterator>::type F;
|
||||
typedef typename BOOST_REGEX_DETAIL_NS::compute_functor_type<Functor, match_results<BidiIterator, Allocator>, OutputIterator>::type F;
|
||||
F func(fmt);
|
||||
return func(*this, out, flags);
|
||||
}
|
||||
@@ -355,9 +355,9 @@ public:
|
||||
if(m_is_singular)
|
||||
raise_logic_error();
|
||||
std::basic_string<char_type> result;
|
||||
re_detail::string_out_iterator<std::basic_string<char_type> > i(result);
|
||||
BOOST_REGEX_DETAIL_NS::string_out_iterator<std::basic_string<char_type> > i(result);
|
||||
|
||||
typedef typename re_detail::compute_functor_type<Functor, match_results<BidiIterator, Allocator>, re_detail::string_out_iterator<std::basic_string<char_type> > >::type F;
|
||||
typedef typename BOOST_REGEX_DETAIL_NS::compute_functor_type<Functor, match_results<BidiIterator, Allocator>, BOOST_REGEX_DETAIL_NS::string_out_iterator<std::basic_string<char_type> > >::type F;
|
||||
F func(fmt);
|
||||
|
||||
func(*this, i, flags);
|
||||
@@ -373,7 +373,7 @@ public:
|
||||
if(m_is_singular)
|
||||
raise_logic_error();
|
||||
typedef ::boost::regex_traits_wrapper<typename RegexT::traits_type> traits_type;
|
||||
typedef typename re_detail::compute_functor_type<Functor, match_results<BidiIterator, Allocator>, OutputIterator, traits_type>::type F;
|
||||
typedef typename BOOST_REGEX_DETAIL_NS::compute_functor_type<Functor, match_results<BidiIterator, Allocator>, OutputIterator, traits_type>::type F;
|
||||
F func(fmt);
|
||||
return func(*this, out, flags, re.get_traits());
|
||||
}
|
||||
@@ -386,9 +386,9 @@ public:
|
||||
raise_logic_error();
|
||||
typedef ::boost::regex_traits_wrapper<typename RegexT::traits_type> traits_type;
|
||||
std::basic_string<char_type> result;
|
||||
re_detail::string_out_iterator<std::basic_string<char_type> > i(result);
|
||||
BOOST_REGEX_DETAIL_NS::string_out_iterator<std::basic_string<char_type> > i(result);
|
||||
|
||||
typedef typename re_detail::compute_functor_type<Functor, match_results<BidiIterator, Allocator>, re_detail::string_out_iterator<std::basic_string<char_type> >, traits_type >::type F;
|
||||
typedef typename BOOST_REGEX_DETAIL_NS::compute_functor_type<Functor, match_results<BidiIterator, Allocator>, BOOST_REGEX_DETAIL_NS::string_out_iterator<std::basic_string<char_type> >, traits_type >::type F;
|
||||
F func(fmt);
|
||||
|
||||
func(*this, i, flags, re.get_traits());
|
||||
@@ -639,15 +639,15 @@ void BOOST_REGEX_CALL match_results<BidiIterator, Allocator>::maybe_assign(const
|
||||
// p1 better than p2, and no need to calculate distances:
|
||||
return;
|
||||
}
|
||||
base1 = ::boost::re_detail::distance(l_base, p1->first);
|
||||
base2 = ::boost::re_detail::distance(l_base, p2->first);
|
||||
base1 = ::boost::BOOST_REGEX_DETAIL_NS::distance(l_base, p1->first);
|
||||
base2 = ::boost::BOOST_REGEX_DETAIL_NS::distance(l_base, p2->first);
|
||||
BOOST_ASSERT(base1 >= 0);
|
||||
BOOST_ASSERT(base2 >= 0);
|
||||
if(base1 < base2) return;
|
||||
if(base2 < base1) break;
|
||||
|
||||
len1 = ::boost::re_detail::distance((BidiIterator)p1->first, (BidiIterator)p1->second);
|
||||
len2 = ::boost::re_detail::distance((BidiIterator)p2->first, (BidiIterator)p2->second);
|
||||
len1 = ::boost::BOOST_REGEX_DETAIL_NS::distance((BidiIterator)p1->first, (BidiIterator)p1->second);
|
||||
len2 = ::boost::BOOST_REGEX_DETAIL_NS::distance((BidiIterator)p2->first, (BidiIterator)p2->second);
|
||||
BOOST_ASSERT(len1 >= 0);
|
||||
BOOST_ASSERT(len2 >= 0);
|
||||
if((len1 != len2) || ((p1->matched == false) && (p2->matched == true)))
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
#endif
|
||||
|
||||
namespace boost{
|
||||
namespace re_detail{
|
||||
namespace BOOST_REGEX_DETAIL_NS{
|
||||
|
||||
struct mem_block_node
|
||||
{
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
#endif
|
||||
|
||||
namespace boost{
|
||||
namespace re_detail{
|
||||
namespace BOOST_REGEX_DETAIL_NS{
|
||||
|
||||
//
|
||||
// error checking API:
|
||||
@@ -253,23 +253,40 @@ class repeater_count
|
||||
int state_id;
|
||||
std::size_t count; // the number of iterations so far
|
||||
BidiIterator start_pos; // where the last repeat started
|
||||
|
||||
repeater_count* unwind_until(int n, repeater_count* p, int current_recursion_id)
|
||||
{
|
||||
while(p && (p->state_id != n))
|
||||
{
|
||||
if(-2 - current_recursion_id == p->state_id)
|
||||
return 0;
|
||||
p = p->next;
|
||||
if(p && (p->state_id < 0))
|
||||
{
|
||||
p = unwind_until(p->state_id, p, current_recursion_id);
|
||||
if(!p)
|
||||
return p;
|
||||
p = p->next;
|
||||
}
|
||||
}
|
||||
return p;
|
||||
}
|
||||
public:
|
||||
repeater_count(repeater_count** s) : stack(s), next(0), state_id(-1), count(0), start_pos() {}
|
||||
|
||||
repeater_count(int i, repeater_count** s, BidiIterator start)
|
||||
|
||||
repeater_count(int i, repeater_count** s, BidiIterator start, int current_recursion_id)
|
||||
: start_pos(start)
|
||||
{
|
||||
state_id = i;
|
||||
stack = s;
|
||||
next = *stack;
|
||||
*stack = this;
|
||||
if(state_id > next->state_id)
|
||||
if((state_id > next->state_id) && (next->state_id >= 0))
|
||||
count = 0;
|
||||
else
|
||||
{
|
||||
repeater_count* p = next;
|
||||
while(p && (p->state_id != state_id))
|
||||
p = p->next;
|
||||
p = unwind_until(state_id, p, current_recursion_id);
|
||||
if(p)
|
||||
{
|
||||
count = p->count;
|
||||
@@ -426,6 +443,11 @@ private:
|
||||
bool backtrack_till_match(std::size_t count);
|
||||
#endif
|
||||
bool match_recursion();
|
||||
bool match_fail();
|
||||
bool match_accept();
|
||||
bool match_commit();
|
||||
bool match_then();
|
||||
bool skip_until_paren(int index, bool match = true);
|
||||
|
||||
// find procs stored in s_find_vtable:
|
||||
bool find_restart_any();
|
||||
@@ -483,7 +505,12 @@ private:
|
||||
unsigned char match_any_mask;
|
||||
// recursion information:
|
||||
std::vector<recursion_info<results_type> > recursion_stack;
|
||||
|
||||
#ifdef BOOST_REGEX_RECURSIVE
|
||||
// Set to false by a (*COMMIT):
|
||||
bool m_can_backtrack;
|
||||
bool m_have_accept;
|
||||
bool m_have_then;
|
||||
#endif
|
||||
#ifdef BOOST_REGEX_NON_RECURSIVE
|
||||
//
|
||||
// additional members for non-recursive version:
|
||||
@@ -508,6 +535,8 @@ private:
|
||||
bool unwind_non_greedy_repeat(bool);
|
||||
bool unwind_recursion(bool);
|
||||
bool unwind_recursion_pop(bool);
|
||||
bool unwind_commit(bool);
|
||||
bool unwind_then(bool);
|
||||
void destroy_single_repeat();
|
||||
void push_matched_paren(int index, const sub_match<BidiIterator>& sub);
|
||||
void push_recursion_stopper();
|
||||
@@ -523,11 +552,17 @@ private:
|
||||
saved_state* m_stack_base;
|
||||
// pointer to current stack position:
|
||||
saved_state* m_backup_state;
|
||||
// how many memory blocks have we used up?:
|
||||
unsigned used_block_count;
|
||||
// determines what value to return when unwinding from recursion,
|
||||
// allows for mixed recursive/non-recursive algorithm:
|
||||
bool m_recursive_result;
|
||||
// how many memory blocks have we used up?:
|
||||
unsigned used_block_count;
|
||||
// We have unwound to a lookahead/lookbehind, used by COMMIT/PRUNE/SKIP:
|
||||
bool m_unwound_lookahead;
|
||||
// We have unwound to an alternative, used by THEN:
|
||||
bool m_unwound_alt;
|
||||
// We are unwinding a commit - used by independent subs to determine whether to stop there or carry on unwinding:
|
||||
//bool m_unwind_commit;
|
||||
#endif
|
||||
|
||||
// these operations aren't allowed, so are declared private,
|
||||
@@ -544,7 +579,7 @@ private:
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
||||
} // namespace re_detail
|
||||
} // namespace BOOST_REGEX_DETAIL_NS
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma warning(push)
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
#endif
|
||||
|
||||
namespace boost{
|
||||
namespace re_detail{
|
||||
namespace BOOST_REGEX_DETAIL_NS{
|
||||
|
||||
template <class BidiIterator, class Allocator, class traits>
|
||||
void perl_matcher<BidiIterator, Allocator, traits>::construct_init(const basic_regex<char_type, traits>& e, match_flag_type f)
|
||||
@@ -80,11 +80,17 @@ void perl_matcher<BidiIterator, Allocator, traits>::construct_init(const basic_r
|
||||
#ifdef BOOST_REGEX_NON_RECURSIVE
|
||||
m_stack_base = 0;
|
||||
m_backup_state = 0;
|
||||
#elif defined(BOOST_REGEX_RECURSIVE)
|
||||
m_can_backtrack = true;
|
||||
m_have_accept = false;
|
||||
#endif
|
||||
// find the value to use for matching word boundaries:
|
||||
m_word_mask = re.get_data().m_word_mask;
|
||||
// find bitmask to use for matching '.':
|
||||
match_any_mask = static_cast<unsigned char>((f & match_not_dot_newline) ? re_detail::test_not_newline : re_detail::test_newline);
|
||||
match_any_mask = static_cast<unsigned char>((f & match_not_dot_newline) ? BOOST_REGEX_DETAIL_NS::test_not_newline : BOOST_REGEX_DETAIL_NS::test_newline);
|
||||
// Disable match_any if requested in the state machine:
|
||||
if(e.get_data().m_disable_match_any)
|
||||
m_match_flags &= ~regex_constants::match_any;
|
||||
}
|
||||
|
||||
template <class BidiIterator, class Allocator, class traits>
|
||||
@@ -101,7 +107,7 @@ void perl_matcher<BidiIterator, Allocator, traits>::estimate_max_state_count(std
|
||||
// Calculate NS^2 first:
|
||||
//
|
||||
static const std::ptrdiff_t k = 100000;
|
||||
std::ptrdiff_t dist = boost::re_detail::distance(base, last);
|
||||
std::ptrdiff_t dist = boost::BOOST_REGEX_DETAIL_NS::distance(base, last);
|
||||
if(dist == 0)
|
||||
dist = 1;
|
||||
std::ptrdiff_t states = re.size();
|
||||
@@ -165,7 +171,7 @@ template <class BidiIterator, class Allocator, class traits>
|
||||
inline bool perl_matcher<BidiIterator, Allocator, traits>::protected_call(
|
||||
protected_proc_type proc)
|
||||
{
|
||||
::boost::re_detail::concrete_protected_call
|
||||
::boost::BOOST_REGEX_DETAIL_NS::concrete_protected_call
|
||||
<perl_matcher<BidiIterator, Allocator, traits> >
|
||||
obj(this, proc);
|
||||
return obj.execute();
|
||||
@@ -348,6 +354,9 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_prefix()
|
||||
#endif
|
||||
if(!m_has_found_match)
|
||||
position = restart; // reset search postion
|
||||
#ifdef BOOST_REGEX_RECURSIVE
|
||||
m_can_backtrack = true; // reset for further searches
|
||||
#endif
|
||||
return m_has_found_match;
|
||||
}
|
||||
|
||||
@@ -703,7 +712,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_backstep()
|
||||
#endif
|
||||
if( ::boost::is_random_access_iterator<BidiIterator>::value)
|
||||
{
|
||||
std::ptrdiff_t maxlen = ::boost::re_detail::distance(backstop, position);
|
||||
std::ptrdiff_t maxlen = ::boost::BOOST_REGEX_DETAIL_NS::distance(backstop, position);
|
||||
if(maxlen < static_cast<const re_brace*>(pstate)->index)
|
||||
return false;
|
||||
std::advance(position, -static_cast<const re_brace*>(pstate)->index);
|
||||
@@ -793,6 +802,25 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_toggle_case()
|
||||
return true;
|
||||
}
|
||||
|
||||
template <class BidiIterator, class Allocator, class traits>
|
||||
bool perl_matcher<BidiIterator, Allocator, traits>::match_fail()
|
||||
{
|
||||
// Just force a backtrack:
|
||||
return false;
|
||||
}
|
||||
|
||||
template <class BidiIterator, class Allocator, class traits>
|
||||
bool perl_matcher<BidiIterator, Allocator, traits>::match_accept()
|
||||
{
|
||||
if(!recursion_stack.empty())
|
||||
{
|
||||
return skip_until_paren(recursion_stack.back().idx);
|
||||
}
|
||||
else
|
||||
{
|
||||
return skip_until_paren(INT_MAX);
|
||||
}
|
||||
}
|
||||
|
||||
template <class BidiIterator, class Allocator, class traits>
|
||||
bool perl_matcher<BidiIterator, Allocator, traits>::find_restart_any()
|
||||
@@ -966,7 +994,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::find_restart_lit()
|
||||
return false;
|
||||
}
|
||||
|
||||
} // namespace re_detail
|
||||
} // namespace BOOST_REGEX_DETAIL_NS
|
||||
|
||||
} // namespace boost
|
||||
|
||||
|
||||
@@ -34,11 +34,11 @@
|
||||
#endif
|
||||
#ifdef BOOST_MSVC
|
||||
# pragma warning(push)
|
||||
# pragma warning(disable: 4800)
|
||||
# pragma warning(disable: 4800 4706)
|
||||
#endif
|
||||
|
||||
namespace boost{
|
||||
namespace re_detail{
|
||||
namespace BOOST_REGEX_DETAIL_NS{
|
||||
|
||||
template <class T>
|
||||
inline void inplace_destroy(T* p)
|
||||
@@ -87,8 +87,8 @@ template <class BidiIterator>
|
||||
struct saved_repeater : public saved_state
|
||||
{
|
||||
repeater_count<BidiIterator> count;
|
||||
saved_repeater(int i, repeater_count<BidiIterator>** s, BidiIterator start)
|
||||
: saved_state(saved_state_repeater_count), count(i,s,start){}
|
||||
saved_repeater(int i, repeater_count<BidiIterator>** s, BidiIterator start, int current_recursion_id)
|
||||
: saved_state(saved_state_repeater_count), count(i, s, start, current_recursion_id){}
|
||||
};
|
||||
|
||||
struct saved_extra_block : public saved_state
|
||||
@@ -141,7 +141,7 @@ struct saved_recursion : public saved_state
|
||||
template <class BidiIterator, class Allocator, class traits>
|
||||
bool perl_matcher<BidiIterator, Allocator, traits>::match_all_states()
|
||||
{
|
||||
static matcher_proc_type const s_match_vtable[30] =
|
||||
static matcher_proc_type const s_match_vtable[34] =
|
||||
{
|
||||
(&perl_matcher<BidiIterator, Allocator, traits>::match_startmark),
|
||||
&perl_matcher<BidiIterator, Allocator, traits>::match_endmark,
|
||||
@@ -177,6 +177,10 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_all_states()
|
||||
&perl_matcher<BidiIterator, Allocator, traits>::match_assert_backref,
|
||||
&perl_matcher<BidiIterator, Allocator, traits>::match_toggle_case,
|
||||
&perl_matcher<BidiIterator, Allocator, traits>::match_recursion,
|
||||
&perl_matcher<BidiIterator, Allocator, traits>::match_fail,
|
||||
&perl_matcher<BidiIterator, Allocator, traits>::match_accept,
|
||||
&perl_matcher<BidiIterator, Allocator, traits>::match_commit,
|
||||
&perl_matcher<BidiIterator, Allocator, traits>::match_then,
|
||||
};
|
||||
|
||||
push_recursion_stopper();
|
||||
@@ -309,7 +313,7 @@ inline void perl_matcher<BidiIterator, Allocator, traits>::push_repeater_count(i
|
||||
pmp = static_cast<saved_repeater<BidiIterator>*>(m_backup_state);
|
||||
--pmp;
|
||||
}
|
||||
(void) new (pmp)saved_repeater<BidiIterator>(i, s, position);
|
||||
(void) new (pmp)saved_repeater<BidiIterator>(i, s, position, this->recursion_stack.size() ? this->recursion_stack.back().idx : (INT_MIN + 3));
|
||||
m_backup_state = pmp;
|
||||
}
|
||||
|
||||
@@ -370,6 +374,13 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_startmark()
|
||||
const re_syntax_base* next_pstate = static_cast<const re_jump*>(pstate->next.p)->alt.p->next.p;
|
||||
pstate = pstate->next.p->next.p;
|
||||
bool r = match_all_states();
|
||||
if(!r && !m_independent)
|
||||
{
|
||||
// Must be unwinding from a COMMIT/SKIP/PRUNE and the independent
|
||||
// sub failed, need to unwind everything else:
|
||||
while(unwind(false));
|
||||
return false;
|
||||
}
|
||||
pstate = next_pstate;
|
||||
m_independent = old_independent;
|
||||
#ifdef BOOST_REGEX_MATCH_EXTRA
|
||||
@@ -652,7 +663,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_dot_repeat_fast()
|
||||
|
||||
const re_repeat* rep = static_cast<const re_repeat*>(pstate);
|
||||
bool greedy = (rep->greedy) && (!(m_match_flags & regex_constants::match_any) || m_independent);
|
||||
unsigned count = static_cast<unsigned>((std::min)(static_cast<unsigned>(::boost::re_detail::distance(position, last)), static_cast<unsigned>(greedy ? rep->max : rep->min)));
|
||||
unsigned count = static_cast<unsigned>((std::min)(static_cast<unsigned>(::boost::BOOST_REGEX_DETAIL_NS::distance(position, last)), static_cast<unsigned>(greedy ? rep->max : rep->min)));
|
||||
if(rep->min > count)
|
||||
{
|
||||
position = last;
|
||||
@@ -705,7 +716,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_char_repeat()
|
||||
BidiIterator end = position;
|
||||
// Move end forward by "desired", preferably without using distance or advance if we can
|
||||
// as these can be slow for some iterator types.
|
||||
std::size_t len = (desired == (std::numeric_limits<std::size_t>::max)()) ? 0u : ::boost::re_detail::distance(position, last);
|
||||
std::size_t len = (desired == (std::numeric_limits<std::size_t>::max)()) ? 0u : ::boost::BOOST_REGEX_DETAIL_NS::distance(position, last);
|
||||
if(desired >= len)
|
||||
end = last;
|
||||
else
|
||||
@@ -715,7 +726,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_char_repeat()
|
||||
{
|
||||
++position;
|
||||
}
|
||||
count = (unsigned)::boost::re_detail::distance(origin, position);
|
||||
count = (unsigned)::boost::BOOST_REGEX_DETAIL_NS::distance(origin, position);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -779,7 +790,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_set_repeat()
|
||||
BidiIterator end = position;
|
||||
// Move end forward by "desired", preferably without using distance or advance if we can
|
||||
// as these can be slow for some iterator types.
|
||||
std::size_t len = (desired == (std::numeric_limits<std::size_t>::max)()) ? 0u : ::boost::re_detail::distance(position, last);
|
||||
std::size_t len = (desired == (std::numeric_limits<std::size_t>::max)()) ? 0u : ::boost::BOOST_REGEX_DETAIL_NS::distance(position, last);
|
||||
if(desired >= len)
|
||||
end = last;
|
||||
else
|
||||
@@ -789,7 +800,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_set_repeat()
|
||||
{
|
||||
++position;
|
||||
}
|
||||
count = (unsigned)::boost::re_detail::distance(origin, position);
|
||||
count = (unsigned)::boost::BOOST_REGEX_DETAIL_NS::distance(origin, position);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -854,7 +865,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_long_set_repeat()
|
||||
BidiIterator end = position;
|
||||
// Move end forward by "desired", preferably without using distance or advance if we can
|
||||
// as these can be slow for some iterator types.
|
||||
std::size_t len = (desired == (std::numeric_limits<std::size_t>::max)()) ? 0u : ::boost::re_detail::distance(position, last);
|
||||
std::size_t len = (desired == (std::numeric_limits<std::size_t>::max)()) ? 0u : ::boost::BOOST_REGEX_DETAIL_NS::distance(position, last);
|
||||
if(desired >= len)
|
||||
end = last;
|
||||
else
|
||||
@@ -864,7 +875,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_long_set_repeat()
|
||||
{
|
||||
++position;
|
||||
}
|
||||
count = (unsigned)::boost::re_detail::distance(origin, position);
|
||||
count = (unsigned)::boost::BOOST_REGEX_DETAIL_NS::distance(origin, position);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -923,12 +934,12 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_recursion()
|
||||
recursion_stack.push_back(recursion_info<results_type>());
|
||||
recursion_stack.back().preturn_address = pstate->next.p;
|
||||
recursion_stack.back().results = *m_presult;
|
||||
if(static_cast<const re_recurse*>(pstate)->state_id > 0)
|
||||
{
|
||||
push_repeater_count(static_cast<const re_recurse*>(pstate)->state_id, &next_count);
|
||||
}
|
||||
pstate = static_cast<const re_jump*>(pstate)->alt.p;
|
||||
recursion_stack.back().idx = static_cast<const re_brace*>(pstate)->index;
|
||||
//if(static_cast<const re_recurse*>(pstate)->state_id > 0)
|
||||
{
|
||||
push_repeater_count(-(2 + static_cast<const re_brace*>(pstate)->index), &next_count);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -952,6 +963,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_endmark()
|
||||
*m_presult = recursion_stack.back().results;
|
||||
push_recursion(recursion_stack.back().idx, recursion_stack.back().preturn_address, &recursion_stack.back().results);
|
||||
recursion_stack.pop_back();
|
||||
push_repeater_count(-(2 + index), &next_count);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1003,6 +1015,103 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_match()
|
||||
return true;
|
||||
}
|
||||
|
||||
template <class BidiIterator, class Allocator, class traits>
|
||||
bool perl_matcher<BidiIterator, Allocator, traits>::match_commit()
|
||||
{
|
||||
// Ideally we would just junk all the states that are on the stack,
|
||||
// however we might not unwind correctly in that case, so for now,
|
||||
// just mark that we don't backtrack into whatever is left (or rather
|
||||
// we'll unwind it unconditionally without pausing to try other matches).
|
||||
|
||||
switch(static_cast<const re_commit*>(pstate)->action)
|
||||
{
|
||||
case commit_commit:
|
||||
restart = last;
|
||||
break;
|
||||
case commit_skip:
|
||||
if(base != position)
|
||||
{
|
||||
restart = position;
|
||||
// Have to decrement restart since it will get incremented again later:
|
||||
--restart;
|
||||
}
|
||||
break;
|
||||
case commit_prune:
|
||||
break;
|
||||
}
|
||||
|
||||
saved_state* pmp = m_backup_state;
|
||||
--pmp;
|
||||
if(pmp < m_stack_base)
|
||||
{
|
||||
extend_stack();
|
||||
pmp = m_backup_state;
|
||||
--pmp;
|
||||
}
|
||||
(void) new (pmp)saved_state(16);
|
||||
m_backup_state = pmp;
|
||||
pstate = pstate->next.p;
|
||||
return true;
|
||||
}
|
||||
|
||||
template <class BidiIterator, class Allocator, class traits>
|
||||
bool perl_matcher<BidiIterator, Allocator, traits>::match_then()
|
||||
{
|
||||
// Just leave a mark that we need to skip to next alternative:
|
||||
saved_state* pmp = m_backup_state;
|
||||
--pmp;
|
||||
if(pmp < m_stack_base)
|
||||
{
|
||||
extend_stack();
|
||||
pmp = m_backup_state;
|
||||
--pmp;
|
||||
}
|
||||
(void) new (pmp)saved_state(17);
|
||||
m_backup_state = pmp;
|
||||
pstate = pstate->next.p;
|
||||
return true;
|
||||
}
|
||||
|
||||
template <class BidiIterator, class Allocator, class traits>
|
||||
bool perl_matcher<BidiIterator, Allocator, traits>::skip_until_paren(int index, bool have_match)
|
||||
{
|
||||
while(pstate)
|
||||
{
|
||||
if(pstate->type == syntax_element_endmark)
|
||||
{
|
||||
if(static_cast<const re_brace*>(pstate)->index == index)
|
||||
{
|
||||
if(have_match)
|
||||
return this->match_endmark();
|
||||
pstate = pstate->next.p;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Unenclosed closing ), occurs when (*ACCEPT) is inside some other
|
||||
// parenthesis which may or may not have other side effects associated with it.
|
||||
match_endmark();
|
||||
if(!pstate)
|
||||
{
|
||||
unwind(true);
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
else if(pstate->type == syntax_element_match)
|
||||
return true;
|
||||
else if(pstate->type == syntax_element_startmark)
|
||||
{
|
||||
int idx = static_cast<const re_brace*>(pstate)->index;
|
||||
pstate = pstate->next.p;
|
||||
skip_until_paren(idx, false);
|
||||
continue;
|
||||
}
|
||||
pstate = pstate->next.p;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
||||
Unwind and associated proceedures follow, these perform what normal stack
|
||||
@@ -1013,7 +1122,7 @@ unwinding does in the recursive implementation.
|
||||
template <class BidiIterator, class Allocator, class traits>
|
||||
bool perl_matcher<BidiIterator, Allocator, traits>::unwind(bool have_match)
|
||||
{
|
||||
static unwind_proc_type const s_unwind_table[18] =
|
||||
static unwind_proc_type const s_unwind_table[19] =
|
||||
{
|
||||
&perl_matcher<BidiIterator, Allocator, traits>::unwind_end,
|
||||
&perl_matcher<BidiIterator, Allocator, traits>::unwind_paren,
|
||||
@@ -1031,9 +1140,13 @@ bool perl_matcher<BidiIterator, Allocator, traits>::unwind(bool have_match)
|
||||
&perl_matcher<BidiIterator, Allocator, traits>::unwind_non_greedy_repeat,
|
||||
&perl_matcher<BidiIterator, Allocator, traits>::unwind_recursion,
|
||||
&perl_matcher<BidiIterator, Allocator, traits>::unwind_recursion_pop,
|
||||
&perl_matcher<BidiIterator, Allocator, traits>::unwind_commit,
|
||||
&perl_matcher<BidiIterator, Allocator, traits>::unwind_then,
|
||||
};
|
||||
|
||||
m_recursive_result = have_match;
|
||||
m_unwound_lookahead = false;
|
||||
m_unwound_alt = false;
|
||||
unwind_proc_type unwinder;
|
||||
bool cont;
|
||||
//
|
||||
@@ -1076,14 +1189,14 @@ bool perl_matcher<BidiIterator, Allocator, traits>::unwind_paren(bool have_match
|
||||
#endif
|
||||
// unwind stack:
|
||||
m_backup_state = pmp+1;
|
||||
boost::re_detail::inplace_destroy(pmp);
|
||||
boost::BOOST_REGEX_DETAIL_NS::inplace_destroy(pmp);
|
||||
return true; // keep looking
|
||||
}
|
||||
|
||||
template <class BidiIterator, class Allocator, class traits>
|
||||
bool perl_matcher<BidiIterator, Allocator, traits>::unwind_recursion_stopper(bool)
|
||||
{
|
||||
boost::re_detail::inplace_destroy(m_backup_state++);
|
||||
boost::BOOST_REGEX_DETAIL_NS::inplace_destroy(m_backup_state++);
|
||||
pstate = 0; // nothing left to search
|
||||
return false; // end of stack nothing more to search
|
||||
}
|
||||
@@ -1096,8 +1209,9 @@ bool perl_matcher<BidiIterator, Allocator, traits>::unwind_assertion(bool r)
|
||||
position = pmp->position;
|
||||
bool result = (r == pmp->positive);
|
||||
m_recursive_result = pmp->positive ? r : !r;
|
||||
boost::re_detail::inplace_destroy(pmp++);
|
||||
boost::BOOST_REGEX_DETAIL_NS::inplace_destroy(pmp++);
|
||||
m_backup_state = pmp;
|
||||
m_unwound_lookahead = true;
|
||||
return !result; // return false if the assertion was matched to stop search.
|
||||
}
|
||||
|
||||
@@ -1110,8 +1224,9 @@ bool perl_matcher<BidiIterator, Allocator, traits>::unwind_alt(bool r)
|
||||
pstate = pmp->pstate;
|
||||
position = pmp->position;
|
||||
}
|
||||
boost::re_detail::inplace_destroy(pmp++);
|
||||
boost::BOOST_REGEX_DETAIL_NS::inplace_destroy(pmp++);
|
||||
m_backup_state = pmp;
|
||||
m_unwound_alt = !r;
|
||||
return r;
|
||||
}
|
||||
|
||||
@@ -1119,7 +1234,7 @@ template <class BidiIterator, class Allocator, class traits>
|
||||
bool perl_matcher<BidiIterator, Allocator, traits>::unwind_repeater_counter(bool)
|
||||
{
|
||||
saved_repeater<BidiIterator>* pmp = static_cast<saved_repeater<BidiIterator>*>(m_backup_state);
|
||||
boost::re_detail::inplace_destroy(pmp++);
|
||||
boost::BOOST_REGEX_DETAIL_NS::inplace_destroy(pmp++);
|
||||
m_backup_state = pmp;
|
||||
return true; // keep looking
|
||||
}
|
||||
@@ -1131,7 +1246,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::unwind_extra_block(bool)
|
||||
void* condemmed = m_stack_base;
|
||||
m_stack_base = pmp->base;
|
||||
m_backup_state = pmp->end;
|
||||
boost::re_detail::inplace_destroy(pmp);
|
||||
boost::BOOST_REGEX_DETAIL_NS::inplace_destroy(pmp);
|
||||
put_mem_block(condemmed);
|
||||
return true; // keep looking
|
||||
}
|
||||
@@ -1140,7 +1255,7 @@ template <class BidiIterator, class Allocator, class traits>
|
||||
inline void perl_matcher<BidiIterator, Allocator, traits>::destroy_single_repeat()
|
||||
{
|
||||
saved_single_repeat<BidiIterator>* p = static_cast<saved_single_repeat<BidiIterator>*>(m_backup_state);
|
||||
boost::re_detail::inplace_destroy(p++);
|
||||
boost::BOOST_REGEX_DETAIL_NS::inplace_destroy(p++);
|
||||
m_backup_state = p;
|
||||
}
|
||||
|
||||
@@ -1532,7 +1647,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::unwind_non_greedy_repeat(boo
|
||||
pstate = pmp->pstate;
|
||||
++(*next_count);
|
||||
}
|
||||
boost::re_detail::inplace_destroy(pmp++);
|
||||
boost::BOOST_REGEX_DETAIL_NS::inplace_destroy(pmp++);
|
||||
m_backup_state = pmp;
|
||||
return r;
|
||||
}
|
||||
@@ -1548,7 +1663,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::unwind_recursion(bool r)
|
||||
recursion_stack.back().preturn_address = pmp->preturn_address;
|
||||
recursion_stack.back().results = pmp->results;
|
||||
}
|
||||
boost::re_detail::inplace_destroy(pmp++);
|
||||
boost::BOOST_REGEX_DETAIL_NS::inplace_destroy(pmp++);
|
||||
m_backup_state = pmp;
|
||||
return true;
|
||||
}
|
||||
@@ -1561,7 +1676,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::unwind_recursion_pop(bool r)
|
||||
{
|
||||
recursion_stack.pop_back();
|
||||
}
|
||||
boost::re_detail::inplace_destroy(pmp++);
|
||||
boost::BOOST_REGEX_DETAIL_NS::inplace_destroy(pmp++);
|
||||
m_backup_state = pmp;
|
||||
return true;
|
||||
}
|
||||
@@ -1580,6 +1695,48 @@ void perl_matcher<BidiIterator, Allocator, traits>::push_recursion_pop()
|
||||
(void) new (pmp)saved_state(15);
|
||||
m_backup_state = pmp;
|
||||
}
|
||||
|
||||
template <class BidiIterator, class Allocator, class traits>
|
||||
bool perl_matcher<BidiIterator, Allocator, traits>::unwind_commit(bool b)
|
||||
{
|
||||
boost::BOOST_REGEX_DETAIL_NS::inplace_destroy(m_backup_state++);
|
||||
while(unwind(b) && !m_unwound_lookahead){}
|
||||
if(m_unwound_lookahead && pstate)
|
||||
{
|
||||
//
|
||||
// If we stop because we just unwound an assertion, put the
|
||||
// commit state back on the stack again:
|
||||
//
|
||||
saved_state* pmp = m_backup_state;
|
||||
--pmp;
|
||||
if(pmp < m_stack_base)
|
||||
{
|
||||
extend_stack();
|
||||
pmp = m_backup_state;
|
||||
--pmp;
|
||||
}
|
||||
(void) new (pmp)saved_state(16);
|
||||
m_backup_state = pmp;
|
||||
}
|
||||
// This prevents us from stopping when we exit from an independent sub-expression:
|
||||
m_independent = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
template <class BidiIterator, class Allocator, class traits>
|
||||
bool perl_matcher<BidiIterator, Allocator, traits>::unwind_then(bool b)
|
||||
{
|
||||
// Unwind everything till we hit an alternative:
|
||||
boost::BOOST_REGEX_DETAIL_NS::inplace_destroy(m_backup_state++);
|
||||
bool result = false;
|
||||
while((result = unwind(b)) && !m_unwound_alt){}
|
||||
// We're now pointing at the next alternative, need one more backtrack
|
||||
// since *all* the other alternatives must fail once we've reached a THEN clause:
|
||||
if(result && m_unwound_alt)
|
||||
unwind(b);
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
template <class BidiIterator, class Allocator, class traits>
|
||||
bool perl_matcher<BidiIterator, Allocator, traits>::unwind_parenthesis_pop(bool r)
|
||||
@@ -1589,7 +1746,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::unwind_parenthesis_pop(bool
|
||||
{
|
||||
--parenthesis_stack_position;
|
||||
}
|
||||
boost::re_detail::inplace_destroy(pmp++);
|
||||
boost::BOOST_REGEX_DETAIL_NS::inplace_destroy(pmp++);
|
||||
m_backup_state = pmp;
|
||||
return true;
|
||||
}
|
||||
@@ -1617,7 +1774,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::unwind_parenthesis_push(bool
|
||||
{
|
||||
parenthesis_stack[parenthesis_stack_position++] = pmp->position;
|
||||
}
|
||||
boost::re_detail::inplace_destroy(pmp++);
|
||||
boost::BOOST_REGEX_DETAIL_NS::inplace_destroy(pmp++);
|
||||
m_backup_state = pmp;
|
||||
return true;
|
||||
}
|
||||
@@ -1637,7 +1794,7 @@ inline void perl_matcher<BidiIterator, Allocator, traits>::push_parenthesis_push
|
||||
m_backup_state = pmp;
|
||||
}
|
||||
*/
|
||||
} // namespace re_detail
|
||||
} // namespace BOOST_REGEX_DETAIL_NS
|
||||
} // namespace boost
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
#endif
|
||||
|
||||
namespace boost{
|
||||
namespace re_detail{
|
||||
namespace BOOST_REGEX_DETAIL_NS{
|
||||
|
||||
template <class BidiIterator>
|
||||
class backup_subex
|
||||
@@ -60,7 +60,7 @@ public:
|
||||
template <class BidiIterator, class Allocator, class traits>
|
||||
bool perl_matcher<BidiIterator, Allocator, traits>::match_all_states()
|
||||
{
|
||||
static matcher_proc_type const s_match_vtable[30] =
|
||||
static matcher_proc_type const s_match_vtable[34] =
|
||||
{
|
||||
(&perl_matcher<BidiIterator, Allocator, traits>::match_startmark),
|
||||
&perl_matcher<BidiIterator, Allocator, traits>::match_endmark,
|
||||
@@ -96,6 +96,10 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_all_states()
|
||||
&perl_matcher<BidiIterator, Allocator, traits>::match_assert_backref,
|
||||
&perl_matcher<BidiIterator, Allocator, traits>::match_toggle_case,
|
||||
&perl_matcher<BidiIterator, Allocator, traits>::match_recursion,
|
||||
&perl_matcher<BidiIterator, Allocator, traits>::match_fail,
|
||||
&perl_matcher<BidiIterator, Allocator, traits>::match_accept,
|
||||
&perl_matcher<BidiIterator, Allocator, traits>::match_commit,
|
||||
&perl_matcher<BidiIterator, Allocator, traits>::match_then,
|
||||
};
|
||||
|
||||
if(state_count > max_state_count)
|
||||
@@ -139,6 +143,8 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_startmark()
|
||||
r = false;
|
||||
else
|
||||
r = true;
|
||||
if(r && m_have_accept)
|
||||
r = skip_until_paren(INT_MAX);
|
||||
break;
|
||||
}
|
||||
case -3:
|
||||
@@ -148,7 +154,10 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_startmark()
|
||||
m_independent = true;
|
||||
const re_syntax_base* next_pstate = static_cast<const re_jump*>(pstate->next.p)->alt.p->next.p;
|
||||
pstate = pstate->next.p->next.p;
|
||||
bool can_backtrack = m_can_backtrack;
|
||||
r = match_all_states();
|
||||
if(r)
|
||||
m_can_backtrack = can_backtrack;
|
||||
pstate = next_pstate;
|
||||
m_independent = old_independent;
|
||||
#ifdef BOOST_REGEX_MATCH_EXTRA
|
||||
@@ -178,6 +187,8 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_startmark()
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if(r && m_have_accept)
|
||||
r = skip_until_paren(INT_MAX);
|
||||
break;
|
||||
}
|
||||
case -4:
|
||||
@@ -278,12 +289,20 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_alt()
|
||||
BidiIterator oldposition(position);
|
||||
const re_syntax_base* old_pstate = jmp->alt.p;
|
||||
pstate = pstate->next.p;
|
||||
m_have_then = false;
|
||||
if(!match_all_states())
|
||||
{
|
||||
pstate = old_pstate;
|
||||
position = oldposition;
|
||||
if(m_have_then)
|
||||
{
|
||||
m_can_backtrack = true;
|
||||
m_have_then = false;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
m_have_then = false;
|
||||
return m_can_backtrack;
|
||||
}
|
||||
pstate = pstate->next.p;
|
||||
return true;
|
||||
@@ -308,7 +327,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_rep()
|
||||
// Always copy the repeat count, so that the state is restored
|
||||
// when we exit this scope:
|
||||
//
|
||||
repeater_count<BidiIterator> r(rep->state_id, &next_count, position);
|
||||
repeater_count<BidiIterator> r(rep->state_id, &next_count, position, this->recursion_stack.size() ? this->recursion_stack.back().idx : INT_MIN + 3);
|
||||
//
|
||||
// If we've had at least one repeat already, and the last one
|
||||
// matched the NULL string then set the repeat count to
|
||||
@@ -354,6 +373,8 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_rep()
|
||||
pstate = rep->next.p;
|
||||
if(match_all_states())
|
||||
return true;
|
||||
if(!m_can_backtrack)
|
||||
return false;
|
||||
// failed repeat, reset posistion and fall through for alternative:
|
||||
position = pos;
|
||||
}
|
||||
@@ -374,6 +395,8 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_rep()
|
||||
pstate = rep->alt.p;
|
||||
if(match_all_states())
|
||||
return true;
|
||||
if(!m_can_backtrack)
|
||||
return false;
|
||||
// failed alternative, reset posistion and fall through for repeat:
|
||||
position = pos;
|
||||
}
|
||||
@@ -438,7 +461,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_dot_repeat_slow()
|
||||
++state_count;
|
||||
if(match_all_states())
|
||||
return true;
|
||||
if(count >= rep->max)
|
||||
if((count >= rep->max) || !m_can_backtrack)
|
||||
return false;
|
||||
++count;
|
||||
pstate = psingle;
|
||||
@@ -472,7 +495,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_dot_repeat_fast()
|
||||
#pragma warning(disable:4267)
|
||||
#endif
|
||||
bool greedy = (rep->greedy) && (!(m_match_flags & regex_constants::match_any) || m_independent);
|
||||
std::size_t count = (std::min)(static_cast<std::size_t>(::boost::re_detail::distance(position, last)), static_cast<std::size_t>(greedy ? rep->max : rep->min));
|
||||
std::size_t count = (std::min)(static_cast<std::size_t>(::boost::BOOST_REGEX_DETAIL_NS::distance(position, last)), static_cast<std::size_t>(greedy ? rep->max : rep->min));
|
||||
if(rep->min > count)
|
||||
{
|
||||
position = last;
|
||||
@@ -503,7 +526,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_dot_repeat_fast()
|
||||
++state_count;
|
||||
if(match_all_states())
|
||||
return true;
|
||||
if(count >= rep->max)
|
||||
if((count >= rep->max) || !m_can_backtrack)
|
||||
return false;
|
||||
if(save_pos == last)
|
||||
return false;
|
||||
@@ -539,7 +562,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_char_repeat()
|
||||
desired =
|
||||
(std::min)(
|
||||
(std::size_t)(greedy ? rep->max : rep->min),
|
||||
(std::size_t)::boost::re_detail::distance(position, last));
|
||||
(std::size_t)::boost::BOOST_REGEX_DETAIL_NS::distance(position, last));
|
||||
count = desired;
|
||||
++desired;
|
||||
if(icase)
|
||||
@@ -597,7 +620,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_char_repeat()
|
||||
++state_count;
|
||||
if(match_all_states())
|
||||
return true;
|
||||
if(count >= rep->max)
|
||||
if((count >= rep->max) || !m_can_backtrack)
|
||||
return false;
|
||||
position = save_pos;
|
||||
if(position == last)
|
||||
@@ -643,7 +666,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_set_repeat()
|
||||
BidiIterator end = position;
|
||||
// Move end forward by "desired", preferably without using distance or advance if we can
|
||||
// as these can be slow for some iterator types.
|
||||
std::size_t len = (desired == (std::numeric_limits<std::size_t>::max)()) ? 0u : ::boost::re_detail::distance(position, last);
|
||||
std::size_t len = (desired == (std::numeric_limits<std::size_t>::max)()) ? 0u : ::boost::BOOST_REGEX_DETAIL_NS::distance(position, last);
|
||||
if(desired >= len)
|
||||
end = last;
|
||||
else
|
||||
@@ -653,7 +676,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_set_repeat()
|
||||
{
|
||||
++position;
|
||||
}
|
||||
count = (unsigned)::boost::re_detail::distance(origin, position);
|
||||
count = (unsigned)::boost::BOOST_REGEX_DETAIL_NS::distance(origin, position);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -692,7 +715,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_set_repeat()
|
||||
++state_count;
|
||||
if(match_all_states())
|
||||
return true;
|
||||
if(count >= rep->max)
|
||||
if((count >= rep->max) || !m_can_backtrack)
|
||||
return false;
|
||||
position = save_pos;
|
||||
if(position == last)
|
||||
@@ -739,7 +762,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_long_set_repeat()
|
||||
BidiIterator end = position;
|
||||
// Move end forward by "desired", preferably without using distance or advance if we can
|
||||
// as these can be slow for some iterator types.
|
||||
std::size_t len = (desired == (std::numeric_limits<std::size_t>::max)()) ? 0u : ::boost::re_detail::distance(position, last);
|
||||
std::size_t len = (desired == (std::numeric_limits<std::size_t>::max)()) ? 0u : ::boost::BOOST_REGEX_DETAIL_NS::distance(position, last);
|
||||
if(desired >= len)
|
||||
end = last;
|
||||
else
|
||||
@@ -749,7 +772,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_long_set_repeat()
|
||||
{
|
||||
++position;
|
||||
}
|
||||
count = (unsigned)::boost::re_detail::distance(origin, position);
|
||||
count = (unsigned)::boost::BOOST_REGEX_DETAIL_NS::distance(origin, position);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -788,7 +811,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_long_set_repeat()
|
||||
++state_count;
|
||||
if(match_all_states())
|
||||
return true;
|
||||
if(count >= rep->max)
|
||||
if((count >= rep->max) || !m_can_backtrack)
|
||||
return false;
|
||||
position = save_pos;
|
||||
if(position == last)
|
||||
@@ -818,6 +841,8 @@ bool perl_matcher<BidiIterator, Allocator, traits>::backtrack_till_match(std::si
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable:4127)
|
||||
#endif
|
||||
if(!m_can_backtrack)
|
||||
return false;
|
||||
if((m_match_flags & match_partial) && (position == last))
|
||||
m_has_partial_match = true;
|
||||
|
||||
@@ -883,7 +908,9 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_recursion()
|
||||
repeater_count<BidiIterator>* saved = next_count;
|
||||
repeater_count<BidiIterator> r(&next_count); // resets all repeat counts since we're recursing and starting fresh on those
|
||||
next_count = &r;
|
||||
bool can_backtrack = m_can_backtrack;
|
||||
bool result = match_all_states();
|
||||
m_can_backtrack = can_backtrack;
|
||||
next_count = saved;
|
||||
|
||||
if(!result)
|
||||
@@ -980,9 +1007,76 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_match()
|
||||
return true;
|
||||
}
|
||||
|
||||
template <class BidiIterator, class Allocator, class traits>
|
||||
bool perl_matcher<BidiIterator, Allocator, traits>::match_commit()
|
||||
{
|
||||
m_can_backtrack = false;
|
||||
int action = static_cast<const re_commit*>(pstate)->action;
|
||||
switch(action)
|
||||
{
|
||||
case commit_commit:
|
||||
restart = last;
|
||||
break;
|
||||
case commit_skip:
|
||||
restart = position;
|
||||
break;
|
||||
}
|
||||
pstate = pstate->next.p;
|
||||
return true;
|
||||
}
|
||||
|
||||
template <class BidiIterator, class Allocator, class traits>
|
||||
bool perl_matcher<BidiIterator, Allocator, traits>::match_then()
|
||||
{
|
||||
pstate = pstate->next.p;
|
||||
if(match_all_states())
|
||||
return true;
|
||||
m_can_backtrack = false;
|
||||
m_have_then = true;
|
||||
return false;
|
||||
}
|
||||
|
||||
template <class BidiIterator, class Allocator, class traits>
|
||||
bool perl_matcher<BidiIterator, Allocator, traits>::skip_until_paren(int index, bool have_match)
|
||||
{
|
||||
while(pstate)
|
||||
{
|
||||
if(pstate->type == syntax_element_endmark)
|
||||
{
|
||||
if(static_cast<const re_brace*>(pstate)->index == index)
|
||||
{
|
||||
if(have_match)
|
||||
return this->match_endmark();
|
||||
pstate = pstate->next.p;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Unenclosed closing ), occurs when (*ACCEPT) is inside some other
|
||||
// parenthesis which may or may not have other side effects associated with it.
|
||||
bool r = match_endmark();
|
||||
m_have_accept = true;
|
||||
if(!pstate)
|
||||
return r;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
else if(pstate->type == syntax_element_match)
|
||||
return true;
|
||||
else if(pstate->type == syntax_element_startmark)
|
||||
{
|
||||
int idx = static_cast<const re_brace*>(pstate)->index;
|
||||
pstate = pstate->next.p;
|
||||
skip_until_paren(idx, false);
|
||||
continue;
|
||||
}
|
||||
pstate = pstate->next.p;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
} // namespace re_detail
|
||||
} // namespace BOOST_REGEX_DETAIL_NS
|
||||
} // namespace boost
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma warning(pop)
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
#endif
|
||||
|
||||
namespace boost{
|
||||
namespace re_detail{
|
||||
namespace BOOST_REGEX_DETAIL_NS{
|
||||
|
||||
|
||||
enum{
|
||||
@@ -122,7 +122,7 @@ unsigned find_sort_syntax(const traits* pt, charT* delim)
|
||||
}
|
||||
|
||||
|
||||
} // namespace re_detail
|
||||
} // namespace BOOST_REGEX_DETAIL_NS
|
||||
} // namespace boost
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
#endif
|
||||
|
||||
namespace boost{
|
||||
namespace re_detail{
|
||||
namespace BOOST_REGEX_DETAIL_NS{
|
||||
|
||||
class BOOST_REGEX_DECL abstract_protected_call
|
||||
{
|
||||
|
||||
@@ -55,7 +55,7 @@ namespace boost{
|
||||
template <class BidiIterator, class Allocator = BOOST_DEDUCED_TYPENAME std::vector<sub_match<BidiIterator> >::allocator_type >
|
||||
class match_results;
|
||||
|
||||
namespace re_detail{
|
||||
namespace BOOST_REGEX_DETAIL_NS{
|
||||
|
||||
//
|
||||
// struct trivial_format_traits:
|
||||
@@ -73,11 +73,11 @@ struct trivial_format_traits
|
||||
}
|
||||
static charT tolower(charT c)
|
||||
{
|
||||
return ::boost::re_detail::global_lower(c);
|
||||
return ::boost::BOOST_REGEX_DETAIL_NS::global_lower(c);
|
||||
}
|
||||
static charT toupper(charT c)
|
||||
{
|
||||
return ::boost::re_detail::global_upper(c);
|
||||
return ::boost::BOOST_REGEX_DETAIL_NS::global_upper(c);
|
||||
}
|
||||
static int value(const charT c, int radix)
|
||||
{
|
||||
@@ -359,7 +359,7 @@ void basic_regex_formatter<OutputIterator, Results, traits, ForwardIter>::format
|
||||
default:
|
||||
// see if we have a number:
|
||||
{
|
||||
std::ptrdiff_t len = ::boost::re_detail::distance(m_position, m_end);
|
||||
std::ptrdiff_t len = ::boost::BOOST_REGEX_DETAIL_NS::distance(m_position, m_end);
|
||||
//len = (std::min)(static_cast<std::ptrdiff_t>(2), len);
|
||||
int v = this->toi(m_position, m_position + len, 10);
|
||||
if((v < 0) || (have_brace && ((m_position == m_end) || (*m_position != '}'))))
|
||||
@@ -570,7 +570,7 @@ void basic_regex_formatter<OutputIterator, Results, traits, ForwardIter>::format
|
||||
}
|
||||
else
|
||||
{
|
||||
std::ptrdiff_t len = ::boost::re_detail::distance(m_position, m_end);
|
||||
std::ptrdiff_t len = ::boost::BOOST_REGEX_DETAIL_NS::distance(m_position, m_end);
|
||||
len = (std::min)(static_cast<std::ptrdiff_t>(2), len);
|
||||
int val = this->toi(m_position, m_position + len, 16);
|
||||
if(val < 0)
|
||||
@@ -634,7 +634,7 @@ void basic_regex_formatter<OutputIterator, Results, traits, ForwardIter>::format
|
||||
break;
|
||||
}
|
||||
// see if we have a \n sed style backreference:
|
||||
std::ptrdiff_t len = ::boost::re_detail::distance(m_position, m_end);
|
||||
std::ptrdiff_t len = ::boost::BOOST_REGEX_DETAIL_NS::distance(m_position, m_end);
|
||||
len = (std::min)(static_cast<std::ptrdiff_t>(1), len);
|
||||
int v = this->toi(m_position, m_position+len, 10);
|
||||
if((v > 0) || ((v == 0) && (m_flags & ::boost::regex_constants::format_sed)))
|
||||
@@ -646,7 +646,7 @@ void basic_regex_formatter<OutputIterator, Results, traits, ForwardIter>::format
|
||||
{
|
||||
// octal ecape sequence:
|
||||
--m_position;
|
||||
len = ::boost::re_detail::distance(m_position, m_end);
|
||||
len = ::boost::BOOST_REGEX_DETAIL_NS::distance(m_position, m_end);
|
||||
len = (std::min)(static_cast<std::ptrdiff_t>(4), len);
|
||||
v = this->toi(m_position, m_position + len, 8);
|
||||
BOOST_ASSERT(v >= 0);
|
||||
@@ -693,7 +693,7 @@ void basic_regex_formatter<OutputIterator, Results, traits, ForwardIter>::format
|
||||
}
|
||||
else
|
||||
{
|
||||
std::ptrdiff_t len = ::boost::re_detail::distance(m_position, m_end);
|
||||
std::ptrdiff_t len = ::boost::BOOST_REGEX_DETAIL_NS::distance(m_position, m_end);
|
||||
len = (std::min)(static_cast<std::ptrdiff_t>(2), len);
|
||||
v = this->toi(m_position, m_position + len, 10);
|
||||
}
|
||||
@@ -835,10 +835,10 @@ OutputIterator regex_format_imp(OutputIterator out,
|
||||
{
|
||||
if(flags & regex_constants::format_literal)
|
||||
{
|
||||
return re_detail::copy(p1, p2, out);
|
||||
return BOOST_REGEX_DETAIL_NS::copy(p1, p2, out);
|
||||
}
|
||||
|
||||
re_detail::basic_regex_formatter<
|
||||
BOOST_REGEX_DETAIL_NS::basic_regex_formatter<
|
||||
OutputIterator,
|
||||
match_results<Iterator, Alloc>,
|
||||
traits, ForwardIter> f(out, m, t);
|
||||
@@ -1028,7 +1028,7 @@ struct format_functor1
|
||||
template <class S, class OutputIter>
|
||||
OutputIter do_format_string(const S& s, OutputIter i)
|
||||
{
|
||||
return re_detail::copy(s.begin(), s.end(), i);
|
||||
return BOOST_REGEX_DETAIL_NS::copy(s.begin(), s.end(), i);
|
||||
}
|
||||
template <class S, class OutputIter>
|
||||
inline OutputIter do_format_string(const S* s, OutputIter i)
|
||||
@@ -1085,7 +1085,7 @@ struct format_functor_container
|
||||
OutputIter operator()(const Match& m, OutputIter i, boost::regex_constants::match_flag_type f, const Traits& t = Traits())
|
||||
{
|
||||
//typedef typename Match::char_type char_type;
|
||||
return re_detail::regex_format_imp(i, m, func.begin(), func.end(), f, t);
|
||||
return BOOST_REGEX_DETAIL_NS::regex_format_imp(i, m, func.begin(), func.end(), f, t);
|
||||
}
|
||||
private:
|
||||
const Container& func;
|
||||
@@ -1093,7 +1093,7 @@ private:
|
||||
format_functor_container& operator=(const format_functor_container&);
|
||||
};
|
||||
|
||||
template <class Func, class Match, class OutputIterator, class Traits = re_detail::trivial_format_traits<typename Match::char_type> >
|
||||
template <class Func, class Match, class OutputIterator, class Traits = BOOST_REGEX_DETAIL_NS::trivial_format_traits<typename Match::char_type> >
|
||||
struct compute_functor_type
|
||||
{
|
||||
typedef typename format_traits<Func, Match, OutputIterator>::type tag;
|
||||
@@ -1114,7 +1114,7 @@ struct compute_functor_type
|
||||
>::type type;
|
||||
};
|
||||
|
||||
} // namespace re_detail
|
||||
} // namespace BOOST_REGEX_DETAIL_NS
|
||||
|
||||
template <class OutputIterator, class Iterator, class Allocator, class Functor>
|
||||
inline OutputIterator regex_format(OutputIterator out,
|
||||
|
||||
@@ -50,7 +50,7 @@ inline unsigned int regex_grep(Predicate foo,
|
||||
typedef typename match_results<BidiIterator>::allocator_type match_allocator_type;
|
||||
|
||||
match_results<BidiIterator> m;
|
||||
re_detail::perl_matcher<BidiIterator, match_allocator_type, traits> matcher(first, last, m, e, flags, first);
|
||||
BOOST_REGEX_DETAIL_NS::perl_matcher<BidiIterator, match_allocator_type, traits> matcher(first, last, m, e, flags, first);
|
||||
unsigned int count = 0;
|
||||
while(matcher.find())
|
||||
{
|
||||
|
||||
@@ -82,14 +82,14 @@ private:
|
||||
};
|
||||
|
||||
template <class BidirectionalIterator,
|
||||
class charT = BOOST_DEDUCED_TYPENAME re_detail::regex_iterator_traits<BidirectionalIterator>::value_type,
|
||||
class charT = BOOST_DEDUCED_TYPENAME BOOST_REGEX_DETAIL_NS::regex_iterator_traits<BidirectionalIterator>::value_type,
|
||||
class traits = regex_traits<charT> >
|
||||
class regex_iterator
|
||||
#ifndef BOOST_NO_STD_ITERATOR
|
||||
: public std::iterator<
|
||||
std::forward_iterator_tag,
|
||||
match_results<BidirectionalIterator>,
|
||||
typename re_detail::regex_iterator_traits<BidirectionalIterator>::difference_type,
|
||||
typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<BidirectionalIterator>::difference_type,
|
||||
const match_results<BidirectionalIterator>*,
|
||||
const match_results<BidirectionalIterator>& >
|
||||
#endif
|
||||
@@ -100,7 +100,7 @@ private:
|
||||
public:
|
||||
typedef basic_regex<charT, traits> regex_type;
|
||||
typedef match_results<BidirectionalIterator> value_type;
|
||||
typedef typename re_detail::regex_iterator_traits<BidirectionalIterator>::difference_type
|
||||
typedef typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<BidirectionalIterator>::difference_type
|
||||
difference_type;
|
||||
typedef const value_type* pointer;
|
||||
typedef const value_type& reference;
|
||||
|
||||
@@ -46,7 +46,7 @@ bool regex_match(BidiIterator first, BidiIterator last,
|
||||
const basic_regex<charT, traits>& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
re_detail::perl_matcher<BidiIterator, Allocator, traits> matcher(first, last, m, e, flags, first);
|
||||
BOOST_REGEX_DETAIL_NS::perl_matcher<BidiIterator, Allocator, traits> matcher(first, last, m, e, flags, first);
|
||||
return matcher.match();
|
||||
}
|
||||
template <class iterator, class charT, class traits>
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
#include <cstddef>
|
||||
|
||||
namespace boost{
|
||||
namespace re_detail{
|
||||
namespace BOOST_REGEX_DETAIL_NS{
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma warning(push)
|
||||
@@ -198,7 +198,7 @@ inline raw_storage::raw_storage(size_type n)
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
||||
} // namespace re_detail
|
||||
} // namespace BOOST_REGEX_DETAIL_NS
|
||||
} // namespace boost
|
||||
|
||||
#endif
|
||||
|
||||
@@ -48,7 +48,7 @@ OutputIterator regex_replace(OutputIterator out,
|
||||
if(i == j)
|
||||
{
|
||||
if(!(flags & regex_constants::format_no_copy))
|
||||
out = re_detail::copy(first, last, out);
|
||||
out = BOOST_REGEX_DETAIL_NS::copy(first, last, out);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -56,7 +56,7 @@ OutputIterator regex_replace(OutputIterator out,
|
||||
while(i != j)
|
||||
{
|
||||
if(!(flags & regex_constants::format_no_copy))
|
||||
out = re_detail::copy(i->prefix().first, i->prefix().second, out);
|
||||
out = BOOST_REGEX_DETAIL_NS::copy(i->prefix().first, i->prefix().second, out);
|
||||
out = i->format(out, fmt, flags, e);
|
||||
last_m = (*i)[0].second;
|
||||
if(flags & regex_constants::format_first_only)
|
||||
@@ -64,7 +64,7 @@ OutputIterator regex_replace(OutputIterator out,
|
||||
++i;
|
||||
}
|
||||
if(!(flags & regex_constants::format_no_copy))
|
||||
out = re_detail::copy(last_m, last, out);
|
||||
out = BOOST_REGEX_DETAIL_NS::copy(last_m, last, out);
|
||||
}
|
||||
return out;
|
||||
}
|
||||
@@ -76,7 +76,7 @@ std::basic_string<charT> regex_replace(const std::basic_string<charT>& s,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
std::basic_string<charT> result;
|
||||
re_detail::string_out_iterator<std::basic_string<charT> > i(result);
|
||||
BOOST_REGEX_DETAIL_NS::string_out_iterator<std::basic_string<charT> > i(result);
|
||||
regex_replace(i, s.begin(), s.end(), e, fmt, flags);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ bool regex_search(BidiIterator first, BidiIterator last,
|
||||
if(e.flags() & regex_constants::failbit)
|
||||
return false;
|
||||
|
||||
re_detail::perl_matcher<BidiIterator, Allocator, traits> matcher(first, last, m, e, flags, base);
|
||||
BOOST_REGEX_DETAIL_NS::perl_matcher<BidiIterator, Allocator, traits> matcher(first, last, m, e, flags, base);
|
||||
return matcher.find();
|
||||
}
|
||||
|
||||
@@ -141,7 +141,7 @@ bool regex_search(BidiIterator first, BidiIterator last,
|
||||
|
||||
match_results<BidiIterator> m;
|
||||
typedef typename match_results<BidiIterator>::allocator_type match_alloc_type;
|
||||
re_detail::perl_matcher<BidiIterator, match_alloc_type, traits> matcher(first, last, m, e, flags | regex_constants::match_any, first);
|
||||
BOOST_REGEX_DETAIL_NS::perl_matcher<BidiIterator, match_alloc_type, traits> matcher(first, last, m, e, flags | regex_constants::match_any, first);
|
||||
return matcher.find();
|
||||
}
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace boost{
|
||||
# pragma warning(disable: 4800)
|
||||
#endif
|
||||
|
||||
namespace re_detail{
|
||||
namespace BOOST_REGEX_DETAIL_NS{
|
||||
|
||||
template <class charT>
|
||||
const basic_regex<charT>& get_default_expression(charT)
|
||||
@@ -97,7 +97,7 @@ bool split_pred<OutputIterator, charT, Traits1, Alloc1>::operator()
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace re_detail
|
||||
} // namespace BOOST_REGEX_DETAIL_NS
|
||||
|
||||
template <class OutputIterator, class charT, class Traits1, class Alloc1, class Traits2>
|
||||
std::size_t regex_split(OutputIterator out,
|
||||
@@ -110,7 +110,7 @@ std::size_t regex_split(OutputIterator out,
|
||||
//typedef typename match_results<ci_t>::allocator_type match_allocator;
|
||||
ci_t last = s.begin();
|
||||
std::size_t init_size = max_split;
|
||||
re_detail::split_pred<OutputIterator, charT, Traits1, Alloc1> pred(&last, &out, &max_split);
|
||||
BOOST_REGEX_DETAIL_NS::split_pred<OutputIterator, charT, Traits1, Alloc1> pred(&last, &out, &max_split);
|
||||
ci_t i, j;
|
||||
i = s.begin();
|
||||
j = s.end();
|
||||
@@ -147,7 +147,7 @@ template <class OutputIterator, class charT, class Traits1, class Alloc1>
|
||||
inline std::size_t regex_split(OutputIterator out,
|
||||
std::basic_string<charT, Traits1, Alloc1>& s)
|
||||
{
|
||||
return regex_split(out, s, re_detail::get_default_expression(charT(0)), match_default, UINT_MAX);
|
||||
return regex_split(out, s, BOOST_REGEX_DETAIL_NS::get_default_expression(charT(0)), match_default, UINT_MAX);
|
||||
}
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
|
||||
@@ -164,14 +164,14 @@ private:
|
||||
};
|
||||
|
||||
template <class BidirectionalIterator,
|
||||
class charT = BOOST_DEDUCED_TYPENAME re_detail::regex_iterator_traits<BidirectionalIterator>::value_type,
|
||||
class charT = BOOST_DEDUCED_TYPENAME BOOST_REGEX_DETAIL_NS::regex_iterator_traits<BidirectionalIterator>::value_type,
|
||||
class traits = regex_traits<charT> >
|
||||
class regex_token_iterator
|
||||
#ifndef BOOST_NO_STD_ITERATOR
|
||||
: public std::iterator<
|
||||
std::forward_iterator_tag,
|
||||
sub_match<BidirectionalIterator>,
|
||||
typename re_detail::regex_iterator_traits<BidirectionalIterator>::difference_type,
|
||||
typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<BidirectionalIterator>::difference_type,
|
||||
const sub_match<BidirectionalIterator>*,
|
||||
const sub_match<BidirectionalIterator>& >
|
||||
#endif
|
||||
@@ -182,7 +182,7 @@ private:
|
||||
public:
|
||||
typedef basic_regex<charT, traits> regex_type;
|
||||
typedef sub_match<BidirectionalIterator> value_type;
|
||||
typedef typename re_detail::regex_iterator_traits<BidirectionalIterator>::difference_type
|
||||
typedef typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<BidirectionalIterator>::difference_type
|
||||
difference_type;
|
||||
typedef const value_type* pointer;
|
||||
typedef const value_type& reference;
|
||||
|
||||
@@ -82,7 +82,7 @@ struct regex_traits : public implementationT
|
||||
// interfaces that we support, in addition to the
|
||||
// required "standard" ones:
|
||||
//
|
||||
namespace re_detail{
|
||||
namespace BOOST_REGEX_DETAIL_NS{
|
||||
#if !BOOST_WORKAROUND(__HP_aCC, < 60000)
|
||||
BOOST_MPL_HAS_XXX_TRAIT_DEF(boost_extensions_tag)
|
||||
#else
|
||||
@@ -99,7 +99,7 @@ struct default_wrapper : public BaseT
|
||||
typedef typename BaseT::char_type char_type;
|
||||
std::string error_string(::boost::regex_constants::error_type e)const
|
||||
{
|
||||
return ::boost::re_detail::get_default_error_string(e);
|
||||
return ::boost::BOOST_REGEX_DETAIL_NS::get_default_error_string(e);
|
||||
}
|
||||
::boost::regex_constants::syntax_type syntax_type(char_type c)const
|
||||
{
|
||||
@@ -111,7 +111,7 @@ struct default_wrapper : public BaseT
|
||||
}
|
||||
int toi(const char_type*& p1, const char_type* p2, int radix)const
|
||||
{
|
||||
return ::boost::re_detail::global_toi(p1, p2, radix, *this);
|
||||
return ::boost::BOOST_REGEX_DETAIL_NS::global_toi(p1, p2, radix, *this);
|
||||
}
|
||||
char_type translate(char_type c, bool icase)const
|
||||
{
|
||||
@@ -123,11 +123,11 @@ struct default_wrapper : public BaseT
|
||||
}
|
||||
char_type tolower(char_type c)const
|
||||
{
|
||||
return ::boost::re_detail::global_lower(c);
|
||||
return ::boost::BOOST_REGEX_DETAIL_NS::global_lower(c);
|
||||
}
|
||||
char_type toupper(char_type c)const
|
||||
{
|
||||
return ::boost::re_detail::global_upper(c);
|
||||
return ::boost::BOOST_REGEX_DETAIL_NS::global_upper(c);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -157,13 +157,13 @@ struct compute_wrapper_base<c_regex_traits<wchar_t>, false>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
} // namespace re_detail
|
||||
} // namespace BOOST_REGEX_DETAIL_NS
|
||||
|
||||
template <class BaseT>
|
||||
struct regex_traits_wrapper
|
||||
: public ::boost::re_detail::compute_wrapper_base<
|
||||
: public ::boost::BOOST_REGEX_DETAIL_NS::compute_wrapper_base<
|
||||
BaseT,
|
||||
::boost::re_detail::has_boost_extensions_tag<BaseT>::value
|
||||
::boost::BOOST_REGEX_DETAIL_NS::has_boost_extensions_tag<BaseT>::value
|
||||
>::type
|
||||
{
|
||||
regex_traits_wrapper(){}
|
||||
|
||||
@@ -30,12 +30,15 @@
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
||||
#include <boost/regex/config.hpp>
|
||||
|
||||
#ifndef BOOST_REGEX_SYNTAX_TYPE_HPP
|
||||
#include <boost/regex/v4/syntax_type.hpp>
|
||||
#endif
|
||||
#ifndef BOOST_REGEX_ERROR_TYPE_HPP
|
||||
#include <boost/regex/v4/error_type.hpp>
|
||||
#endif
|
||||
#include <boost/type_traits/make_unsigned.hpp>
|
||||
|
||||
#ifdef BOOST_NO_STDC_NAMESPACE
|
||||
namespace std{
|
||||
@@ -43,7 +46,7 @@ namespace std{
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace boost{ namespace re_detail{
|
||||
namespace boost{ namespace BOOST_REGEX_DETAIL_NS{
|
||||
|
||||
|
||||
//
|
||||
@@ -51,7 +54,10 @@ namespace boost{ namespace re_detail{
|
||||
//
|
||||
template <class charT>
|
||||
inline bool is_extended(charT c)
|
||||
{ return c > 256; }
|
||||
{
|
||||
typedef typename make_unsigned<charT>::type unsigned_type;
|
||||
return (sizeof(charT) > 1) && (static_cast<unsigned_type>(c) >= 256u);
|
||||
}
|
||||
inline bool is_extended(char)
|
||||
{ return false; }
|
||||
|
||||
@@ -153,7 +159,7 @@ struct character_pointer_range
|
||||
// calling std::equal, but there is no other algorithm available:
|
||||
// not even a non-standard MS one. So forward to unchecked_equal
|
||||
// in the MS case.
|
||||
return ((p2 - p1) == (r.p2 - r.p1)) && re_detail::equal(p1, p2, r.p1);
|
||||
return ((p2 - p1) == (r.p2 - r.p1)) && BOOST_REGEX_DETAIL_NS::equal(p1, p2, r.p1);
|
||||
}
|
||||
};
|
||||
template <class charT>
|
||||
@@ -354,7 +360,7 @@ inline const char* get_escape_R_string<char>()
|
||||
#endif
|
||||
}
|
||||
|
||||
} // re_detail
|
||||
} // BOOST_REGEX_DETAIL_NS
|
||||
} // boost
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
#include <boost/scoped_array.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <boost/mpl/bool_fwd.hpp>
|
||||
#include <boost/regex/config.hpp>
|
||||
#ifndef BOOST_NO_STD_LOCALE
|
||||
# include <locale>
|
||||
#endif
|
||||
@@ -52,7 +53,7 @@ namespace std{
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace boost{ namespace re_detail{
|
||||
namespace boost{ namespace BOOST_REGEX_DETAIL_NS{
|
||||
#ifdef BOOST_NO_STD_DISTANCE
|
||||
template <class T>
|
||||
std::ptrdiff_t distance(const T& x, const T& y)
|
||||
@@ -94,7 +95,7 @@ namespace std{
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
namespace boost{ namespace re_detail{
|
||||
namespace boost{ namespace BOOST_REGEX_DETAIL_NS{
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma warning (push)
|
||||
@@ -123,7 +124,7 @@ inline void pointer_construct(T* p, const T& t)
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
namespace boost{ namespace re_detail{
|
||||
namespace boost{ namespace BOOST_REGEX_DETAIL_NS{
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC,>=1400) && BOOST_WORKAROUND(BOOST_MSVC, <1600) && defined(_CPPLIB_VER) && defined(BOOST_DINKUMWARE_STDLIB) && !(defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION))
|
||||
//
|
||||
// MSVC 8 will either emit warnings or else refuse to compile
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
#endif
|
||||
|
||||
namespace boost{
|
||||
namespace re_detail{
|
||||
namespace BOOST_REGEX_DETAIL_NS{
|
||||
|
||||
/*** mask_type *******************************************************
|
||||
Whenever we have a choice of two alternatives, we use an array of bytes
|
||||
@@ -120,7 +120,12 @@ enum syntax_element_type
|
||||
syntax_element_assert_backref = syntax_element_backstep + 1,
|
||||
syntax_element_toggle_case = syntax_element_assert_backref + 1,
|
||||
// a recursive expression:
|
||||
syntax_element_recurse = syntax_element_toggle_case + 1
|
||||
syntax_element_recurse = syntax_element_toggle_case + 1,
|
||||
// Verbs:
|
||||
syntax_element_fail = syntax_element_recurse + 1,
|
||||
syntax_element_accept = syntax_element_fail + 1,
|
||||
syntax_element_commit = syntax_element_accept + 1,
|
||||
syntax_element_then = syntax_element_commit + 1
|
||||
};
|
||||
|
||||
#ifdef BOOST_REGEX_DEBUG
|
||||
@@ -256,6 +261,21 @@ struct re_recurse : public re_jump
|
||||
int state_id; // identifier of first nested repeat within the recursion.
|
||||
};
|
||||
|
||||
/*** struct re_commit *************************************************
|
||||
Used for the PRUNE, SKIP and COMMIT verbs which basically differ only in what happens
|
||||
if no match is found and we start searching forward.
|
||||
**********************************************************************/
|
||||
enum commit_type
|
||||
{
|
||||
commit_prune,
|
||||
commit_skip,
|
||||
commit_commit
|
||||
};
|
||||
struct re_commit : public re_syntax_base
|
||||
{
|
||||
commit_type action;
|
||||
};
|
||||
|
||||
/*** enum re_jump_size_type *******************************************
|
||||
Provides compiled size of re_jump structure (allowing for trailing alignment).
|
||||
We provide this so we know how manybytes to insert when constructing the machine
|
||||
@@ -281,7 +301,7 @@ iterator BOOST_REGEX_CALL re_is_set_member(iterator next,
|
||||
const re_set_long<char_classT>* set_,
|
||||
const regex_data<charT, traits_type>& e, bool icase);
|
||||
|
||||
} // namespace re_detail
|
||||
} // namespace BOOST_REGEX_DETAIL_NS
|
||||
|
||||
} // namespace boost
|
||||
|
||||
|
||||
@@ -35,11 +35,11 @@ namespace boost{
|
||||
template <class BidiIterator>
|
||||
struct sub_match : public std::pair<BidiIterator, BidiIterator>
|
||||
{
|
||||
typedef typename re_detail::regex_iterator_traits<BidiIterator>::value_type value_type;
|
||||
typedef typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<BidiIterator>::value_type value_type;
|
||||
#if defined(BOOST_NO_STD_ITERATOR_TRAITS)
|
||||
typedef std::ptrdiff_t difference_type;
|
||||
#else
|
||||
typedef typename re_detail::regex_iterator_traits<BidiIterator>::difference_type difference_type;
|
||||
typedef typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<BidiIterator>::difference_type difference_type;
|
||||
#endif
|
||||
typedef BidiIterator iterator_type;
|
||||
typedef BidiIterator iterator;
|
||||
@@ -65,7 +65,7 @@ struct sub_match : public std::pair<BidiIterator, BidiIterator>
|
||||
#endif
|
||||
difference_type BOOST_REGEX_CALL length()const
|
||||
{
|
||||
difference_type n = matched ? ::boost::re_detail::distance((BidiIterator)this->first, (BidiIterator)this->second) : 0;
|
||||
difference_type n = matched ? ::boost::BOOST_REGEX_DETAIL_NS::distance((BidiIterator)this->first, (BidiIterator)this->second) : 0;
|
||||
return n;
|
||||
}
|
||||
std::basic_string<value_type> str()const
|
||||
@@ -73,7 +73,7 @@ struct sub_match : public std::pair<BidiIterator, BidiIterator>
|
||||
std::basic_string<value_type> result;
|
||||
if(matched)
|
||||
{
|
||||
std::size_t len = ::boost::re_detail::distance((BidiIterator)this->first, (BidiIterator)this->second);
|
||||
std::size_t len = ::boost::BOOST_REGEX_DETAIL_NS::distance((BidiIterator)this->first, (BidiIterator)this->second);
|
||||
result.reserve(len);
|
||||
BidiIterator i = this->first;
|
||||
while(i != this->second)
|
||||
@@ -162,6 +162,11 @@ public:
|
||||
#endif
|
||||
return *this;
|
||||
}
|
||||
//
|
||||
// Make this type a range, for both Boost.Range, and C++11:
|
||||
//
|
||||
BidiIterator begin()const { return this->first; }
|
||||
BidiIterator end()const { return this->second; }
|
||||
|
||||
|
||||
#ifdef BOOST_OLD_REGEX_H
|
||||
@@ -190,235 +195,235 @@ typedef sub_match<std::wstring::const_iterator> wssub_match;
|
||||
|
||||
// comparison to std::basic_string<> part 1:
|
||||
template <class RandomAccessIterator, class traits, class Allocator>
|
||||
inline bool operator == (const std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s,
|
||||
inline bool operator == (const std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s,
|
||||
const sub_match<RandomAccessIterator>& m)
|
||||
{ return s.compare(m.str()) == 0; }
|
||||
template <class RandomAccessIterator, class traits, class Allocator>
|
||||
inline bool operator != (const std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s,
|
||||
inline bool operator != (const std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s,
|
||||
const sub_match<RandomAccessIterator>& m)
|
||||
{ return s.compare(m.str()) != 0; }
|
||||
template <class RandomAccessIterator, class traits, class Allocator>
|
||||
inline bool operator < (const std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s,
|
||||
inline bool operator < (const std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s,
|
||||
const sub_match<RandomAccessIterator>& m)
|
||||
{ return s.compare(m.str()) < 0; }
|
||||
template <class RandomAccessIterator, class traits, class Allocator>
|
||||
inline bool operator <= (const std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s,
|
||||
inline bool operator <= (const std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s,
|
||||
const sub_match<RandomAccessIterator>& m)
|
||||
{ return s.compare(m.str()) <= 0; }
|
||||
template <class RandomAccessIterator, class traits, class Allocator>
|
||||
inline bool operator >= (const std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s,
|
||||
inline bool operator >= (const std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s,
|
||||
const sub_match<RandomAccessIterator>& m)
|
||||
{ return s.compare(m.str()) >= 0; }
|
||||
template <class RandomAccessIterator, class traits, class Allocator>
|
||||
inline bool operator > (const std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s,
|
||||
inline bool operator > (const std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s,
|
||||
const sub_match<RandomAccessIterator>& m)
|
||||
{ return s.compare(m.str()) > 0; }
|
||||
// comparison to std::basic_string<> part 2:
|
||||
template <class RandomAccessIterator, class traits, class Allocator>
|
||||
inline bool operator == (const sub_match<RandomAccessIterator>& m,
|
||||
const std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s)
|
||||
const std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s)
|
||||
{ return m.str().compare(s) == 0; }
|
||||
template <class RandomAccessIterator, class traits, class Allocator>
|
||||
inline bool operator != (const sub_match<RandomAccessIterator>& m,
|
||||
const std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s)
|
||||
const std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s)
|
||||
{ return m.str().compare(s) != 0; }
|
||||
template <class RandomAccessIterator, class traits, class Allocator>
|
||||
inline bool operator < (const sub_match<RandomAccessIterator>& m,
|
||||
const std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s)
|
||||
const std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s)
|
||||
{ return m.str().compare(s) < 0; }
|
||||
template <class RandomAccessIterator, class traits, class Allocator>
|
||||
inline bool operator > (const sub_match<RandomAccessIterator>& m,
|
||||
const std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s)
|
||||
const std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s)
|
||||
{ return m.str().compare(s) > 0; }
|
||||
template <class RandomAccessIterator, class traits, class Allocator>
|
||||
inline bool operator <= (const sub_match<RandomAccessIterator>& m,
|
||||
const std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s)
|
||||
const std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s)
|
||||
{ return m.str().compare(s) <= 0; }
|
||||
template <class RandomAccessIterator, class traits, class Allocator>
|
||||
inline bool operator >= (const sub_match<RandomAccessIterator>& m,
|
||||
const std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s)
|
||||
const std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s)
|
||||
{ return m.str().compare(s) >= 0; }
|
||||
// comparison to const charT* part 1:
|
||||
template <class RandomAccessIterator>
|
||||
inline bool operator == (const sub_match<RandomAccessIterator>& m,
|
||||
typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const* s)
|
||||
typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const* s)
|
||||
{ return m.str().compare(s) == 0; }
|
||||
template <class RandomAccessIterator>
|
||||
inline bool operator != (const sub_match<RandomAccessIterator>& m,
|
||||
typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const* s)
|
||||
typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const* s)
|
||||
{ return m.str().compare(s) != 0; }
|
||||
template <class RandomAccessIterator>
|
||||
inline bool operator > (const sub_match<RandomAccessIterator>& m,
|
||||
typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const* s)
|
||||
typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const* s)
|
||||
{ return m.str().compare(s) > 0; }
|
||||
template <class RandomAccessIterator>
|
||||
inline bool operator < (const sub_match<RandomAccessIterator>& m,
|
||||
typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const* s)
|
||||
typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const* s)
|
||||
{ return m.str().compare(s) < 0; }
|
||||
template <class RandomAccessIterator>
|
||||
inline bool operator >= (const sub_match<RandomAccessIterator>& m,
|
||||
typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const* s)
|
||||
typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const* s)
|
||||
{ return m.str().compare(s) >= 0; }
|
||||
template <class RandomAccessIterator>
|
||||
inline bool operator <= (const sub_match<RandomAccessIterator>& m,
|
||||
typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const* s)
|
||||
typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const* s)
|
||||
{ return m.str().compare(s) <= 0; }
|
||||
// comparison to const charT* part 2:
|
||||
template <class RandomAccessIterator>
|
||||
inline bool operator == (typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const* s,
|
||||
inline bool operator == (typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const* s,
|
||||
const sub_match<RandomAccessIterator>& m)
|
||||
{ return m.str().compare(s) == 0; }
|
||||
template <class RandomAccessIterator>
|
||||
inline bool operator != (typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const* s,
|
||||
inline bool operator != (typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const* s,
|
||||
const sub_match<RandomAccessIterator>& m)
|
||||
{ return m.str().compare(s) != 0; }
|
||||
template <class RandomAccessIterator>
|
||||
inline bool operator < (typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const* s,
|
||||
inline bool operator < (typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const* s,
|
||||
const sub_match<RandomAccessIterator>& m)
|
||||
{ return m.str().compare(s) > 0; }
|
||||
template <class RandomAccessIterator>
|
||||
inline bool operator > (typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const* s,
|
||||
inline bool operator > (typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const* s,
|
||||
const sub_match<RandomAccessIterator>& m)
|
||||
{ return m.str().compare(s) < 0; }
|
||||
template <class RandomAccessIterator>
|
||||
inline bool operator <= (typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const* s,
|
||||
inline bool operator <= (typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const* s,
|
||||
const sub_match<RandomAccessIterator>& m)
|
||||
{ return m.str().compare(s) >= 0; }
|
||||
template <class RandomAccessIterator>
|
||||
inline bool operator >= (typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const* s,
|
||||
inline bool operator >= (typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const* s,
|
||||
const sub_match<RandomAccessIterator>& m)
|
||||
{ return m.str().compare(s) <= 0; }
|
||||
|
||||
// comparison to const charT& part 1:
|
||||
template <class RandomAccessIterator>
|
||||
inline bool operator == (const sub_match<RandomAccessIterator>& m,
|
||||
typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const& s)
|
||||
typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const& s)
|
||||
{ return m.str().compare(0, m.length(), &s, 1) == 0; }
|
||||
template <class RandomAccessIterator>
|
||||
inline bool operator != (const sub_match<RandomAccessIterator>& m,
|
||||
typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const& s)
|
||||
typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const& s)
|
||||
{ return m.str().compare(0, m.length(), &s, 1) != 0; }
|
||||
template <class RandomAccessIterator>
|
||||
inline bool operator > (const sub_match<RandomAccessIterator>& m,
|
||||
typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const& s)
|
||||
typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const& s)
|
||||
{ return m.str().compare(0, m.length(), &s, 1) > 0; }
|
||||
template <class RandomAccessIterator>
|
||||
inline bool operator < (const sub_match<RandomAccessIterator>& m,
|
||||
typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const& s)
|
||||
typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const& s)
|
||||
{ return m.str().compare(0, m.length(), &s, 1) < 0; }
|
||||
template <class RandomAccessIterator>
|
||||
inline bool operator >= (const sub_match<RandomAccessIterator>& m,
|
||||
typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const& s)
|
||||
typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const& s)
|
||||
{ return m.str().compare(0, m.length(), &s, 1) >= 0; }
|
||||
template <class RandomAccessIterator>
|
||||
inline bool operator <= (const sub_match<RandomAccessIterator>& m,
|
||||
typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const& s)
|
||||
typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const& s)
|
||||
{ return m.str().compare(0, m.length(), &s, 1) <= 0; }
|
||||
// comparison to const charT* part 2:
|
||||
template <class RandomAccessIterator>
|
||||
inline bool operator == (typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const& s,
|
||||
inline bool operator == (typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const& s,
|
||||
const sub_match<RandomAccessIterator>& m)
|
||||
{ return m.str().compare(0, m.length(), &s, 1) == 0; }
|
||||
template <class RandomAccessIterator>
|
||||
inline bool operator != (typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const& s,
|
||||
inline bool operator != (typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const& s,
|
||||
const sub_match<RandomAccessIterator>& m)
|
||||
{ return m.str().compare(0, m.length(), &s, 1) != 0; }
|
||||
template <class RandomAccessIterator>
|
||||
inline bool operator < (typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const& s,
|
||||
inline bool operator < (typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const& s,
|
||||
const sub_match<RandomAccessIterator>& m)
|
||||
{ return m.str().compare(0, m.length(), &s, 1) > 0; }
|
||||
template <class RandomAccessIterator>
|
||||
inline bool operator > (typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const& s,
|
||||
inline bool operator > (typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const& s,
|
||||
const sub_match<RandomAccessIterator>& m)
|
||||
{ return m.str().compare(0, m.length(), &s, 1) < 0; }
|
||||
template <class RandomAccessIterator>
|
||||
inline bool operator <= (typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const& s,
|
||||
inline bool operator <= (typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const& s,
|
||||
const sub_match<RandomAccessIterator>& m)
|
||||
{ return m.str().compare(0, m.length(), &s, 1) >= 0; }
|
||||
template <class RandomAccessIterator>
|
||||
inline bool operator >= (typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const& s,
|
||||
inline bool operator >= (typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const& s,
|
||||
const sub_match<RandomAccessIterator>& m)
|
||||
{ return m.str().compare(0, m.length(), &s, 1) <= 0; }
|
||||
|
||||
// addition operators:
|
||||
template <class RandomAccessIterator, class traits, class Allocator>
|
||||
inline std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>
|
||||
operator + (const std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s,
|
||||
inline std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>
|
||||
operator + (const std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s,
|
||||
const sub_match<RandomAccessIterator>& m)
|
||||
{
|
||||
std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator> result;
|
||||
std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator> result;
|
||||
result.reserve(s.size() + m.length() + 1);
|
||||
return result.append(s).append(m.first, m.second);
|
||||
}
|
||||
template <class RandomAccessIterator, class traits, class Allocator>
|
||||
inline std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>
|
||||
inline std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>
|
||||
operator + (const sub_match<RandomAccessIterator>& m,
|
||||
const std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s)
|
||||
const std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s)
|
||||
{
|
||||
std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator> result;
|
||||
std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator> result;
|
||||
result.reserve(s.size() + m.length() + 1);
|
||||
return result.append(m.first, m.second).append(s);
|
||||
}
|
||||
#if !(defined(__GNUC__) && defined(BOOST_NO_STD_LOCALE))
|
||||
template <class RandomAccessIterator>
|
||||
inline std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type>
|
||||
operator + (typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const* s,
|
||||
inline std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type>
|
||||
operator + (typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const* s,
|
||||
const sub_match<RandomAccessIterator>& m)
|
||||
{
|
||||
std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type> result;
|
||||
result.reserve(std::char_traits<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type>::length(s) + m.length() + 1);
|
||||
std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type> result;
|
||||
result.reserve(std::char_traits<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type>::length(s) + m.length() + 1);
|
||||
return result.append(s).append(m.first, m.second);
|
||||
}
|
||||
template <class RandomAccessIterator>
|
||||
inline std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type>
|
||||
inline std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type>
|
||||
operator + (const sub_match<RandomAccessIterator>& m,
|
||||
typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const * s)
|
||||
typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const * s)
|
||||
{
|
||||
std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type> result;
|
||||
result.reserve(std::char_traits<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type>::length(s) + m.length() + 1);
|
||||
std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type> result;
|
||||
result.reserve(std::char_traits<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type>::length(s) + m.length() + 1);
|
||||
return result.append(m.first, m.second).append(s);
|
||||
}
|
||||
#else
|
||||
// worwaround versions:
|
||||
template <class RandomAccessIterator>
|
||||
inline std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type>
|
||||
operator + (typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const* s,
|
||||
inline std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type>
|
||||
operator + (typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const* s,
|
||||
const sub_match<RandomAccessIterator>& m)
|
||||
{
|
||||
return s + m.str();
|
||||
}
|
||||
template <class RandomAccessIterator>
|
||||
inline std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type>
|
||||
inline std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type>
|
||||
operator + (const sub_match<RandomAccessIterator>& m,
|
||||
typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const * s)
|
||||
typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const * s)
|
||||
{
|
||||
return m.str() + s;
|
||||
}
|
||||
#endif
|
||||
template <class RandomAccessIterator>
|
||||
inline std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type>
|
||||
operator + (typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const& s,
|
||||
inline std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type>
|
||||
operator + (typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const& s,
|
||||
const sub_match<RandomAccessIterator>& m)
|
||||
{
|
||||
std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type> result;
|
||||
std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type> result;
|
||||
result.reserve(m.length() + 2);
|
||||
return result.append(1, s).append(m.first, m.second);
|
||||
}
|
||||
template <class RandomAccessIterator>
|
||||
inline std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type>
|
||||
inline std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type>
|
||||
operator + (const sub_match<RandomAccessIterator>& m,
|
||||
typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const& s)
|
||||
typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const& s)
|
||||
{
|
||||
std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type> result;
|
||||
std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type> result;
|
||||
result.reserve(m.length() + 2);
|
||||
return result.append(m.first, m.second).append(1, s);
|
||||
}
|
||||
template <class RandomAccessIterator>
|
||||
inline std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type>
|
||||
inline std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type>
|
||||
operator + (const sub_match<RandomAccessIterator>& m1,
|
||||
const sub_match<RandomAccessIterator>& m2)
|
||||
{
|
||||
std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type> result;
|
||||
std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type> result;
|
||||
result.reserve(m1.length() + m2.length() + 1);
|
||||
return result.append(m1.first, m1.second).append(m2.first, m2.second);
|
||||
}
|
||||
@@ -440,7 +445,7 @@ std::ostream& operator << (std::ostream& os,
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_OLD_REGEX_H
|
||||
namespace re_detail{
|
||||
namespace BOOST_REGEX_DETAIL_NS{
|
||||
template <class BidiIterator, class charT>
|
||||
int do_toi(BidiIterator i, BidiIterator j, char c, int radix)
|
||||
{
|
||||
@@ -479,7 +484,7 @@ sub_match<BidiIterator>::operator int()const
|
||||
neg = -1;
|
||||
++i;
|
||||
}
|
||||
neg *= re_detail::do_toi(i, j, *i);
|
||||
neg *= BOOST_REGEX_DETAIL_NS::do_toi(i, j, *i);
|
||||
if(i != j)raise_regex_exception("Bad sub-expression");
|
||||
return neg;
|
||||
}
|
||||
@@ -490,7 +495,7 @@ sub_match<BidiIterator>::operator unsigned int()const
|
||||
BidiIterator j = second;
|
||||
if(i == j)
|
||||
raise_regex_exception("Bad sub-expression");
|
||||
return re_detail::do_toi(i, j, *first);
|
||||
return BOOST_REGEX_DETAIL_NS::do_toi(i, j, *first);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ class u32regex_iterator
|
||||
: public std::iterator<
|
||||
std::forward_iterator_tag,
|
||||
match_results<BidirectionalIterator>,
|
||||
typename re_detail::regex_iterator_traits<BidirectionalIterator>::difference_type,
|
||||
typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<BidirectionalIterator>::difference_type,
|
||||
const match_results<BidirectionalIterator>*,
|
||||
const match_results<BidirectionalIterator>& >
|
||||
#endif
|
||||
@@ -87,7 +87,7 @@ private:
|
||||
public:
|
||||
typedef u32regex regex_type;
|
||||
typedef match_results<BidirectionalIterator> value_type;
|
||||
typedef typename re_detail::regex_iterator_traits<BidirectionalIterator>::difference_type
|
||||
typedef typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<BidirectionalIterator>::difference_type
|
||||
difference_type;
|
||||
typedef const value_type* pointer;
|
||||
typedef const value_type& reference;
|
||||
|
||||
@@ -159,7 +159,7 @@ class u32regex_token_iterator
|
||||
: public std::iterator<
|
||||
std::forward_iterator_tag,
|
||||
sub_match<BidirectionalIterator>,
|
||||
typename re_detail::regex_iterator_traits<BidirectionalIterator>::difference_type,
|
||||
typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<BidirectionalIterator>::difference_type,
|
||||
const sub_match<BidirectionalIterator>*,
|
||||
const sub_match<BidirectionalIterator>& >
|
||||
#endif
|
||||
@@ -170,7 +170,7 @@ private:
|
||||
public:
|
||||
typedef u32regex regex_type;
|
||||
typedef sub_match<BidirectionalIterator> value_type;
|
||||
typedef typename re_detail::regex_iterator_traits<BidirectionalIterator>::difference_type
|
||||
typedef typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<BidirectionalIterator>::difference_type
|
||||
difference_type;
|
||||
typedef const value_type* pointer;
|
||||
typedef const value_type& reference;
|
||||
|
||||
@@ -19,6 +19,8 @@
|
||||
#ifndef BOOST_W32_REGEX_TRAITS_HPP_INCLUDED
|
||||
#define BOOST_W32_REGEX_TRAITS_HPP_INCLUDED
|
||||
|
||||
#ifndef BOOST_REGEX_NO_WIN32_LOCALE
|
||||
|
||||
#ifndef BOOST_RE_PAT_EXCEPT_HPP
|
||||
#include <boost/regex/pattern_except.hpp>
|
||||
#endif
|
||||
@@ -60,7 +62,7 @@ namespace boost{
|
||||
template <class charT>
|
||||
class w32_regex_traits;
|
||||
|
||||
namespace re_detail{
|
||||
namespace BOOST_REGEX_DETAIL_NS{
|
||||
|
||||
//
|
||||
// start by typedeffing the types we'll need:
|
||||
@@ -164,19 +166,19 @@ public:
|
||||
map_iterator_type i = m_char_map.find(c);
|
||||
if(i == m_char_map.end())
|
||||
{
|
||||
if(::boost::re_detail::w32_is_lower(c, this->m_locale)) return regex_constants::escape_type_class;
|
||||
if(::boost::re_detail::w32_is_upper(c, this->m_locale)) return regex_constants::escape_type_not_class;
|
||||
if(::boost::BOOST_REGEX_DETAIL_NS::w32_is_lower(c, this->m_locale)) return regex_constants::escape_type_class;
|
||||
if(::boost::BOOST_REGEX_DETAIL_NS::w32_is_upper(c, this->m_locale)) return regex_constants::escape_type_not_class;
|
||||
return 0;
|
||||
}
|
||||
return i->second;
|
||||
}
|
||||
charT tolower(charT c)const
|
||||
{
|
||||
return ::boost::re_detail::w32_tolower(c, this->m_locale);
|
||||
return ::boost::BOOST_REGEX_DETAIL_NS::w32_tolower(c, this->m_locale);
|
||||
}
|
||||
bool isctype(boost::uint32_t mask, charT c)const
|
||||
{
|
||||
return ::boost::re_detail::w32_is(this->m_locale, mask, c);
|
||||
return ::boost::BOOST_REGEX_DETAIL_NS::w32_is(this->m_locale, mask, c);
|
||||
}
|
||||
|
||||
private:
|
||||
@@ -186,7 +188,7 @@ private:
|
||||
};
|
||||
|
||||
template <class charT>
|
||||
w32_regex_traits_char_layer<charT>::w32_regex_traits_char_layer(::boost::re_detail::lcid_type l)
|
||||
w32_regex_traits_char_layer<charT>::w32_regex_traits_char_layer(::boost::BOOST_REGEX_DETAIL_NS::lcid_type l)
|
||||
: w32_regex_traits_base<charT>(l)
|
||||
{
|
||||
// we need to start by initialising our syntax map so we know which
|
||||
@@ -195,12 +197,12 @@ w32_regex_traits_char_layer<charT>::w32_regex_traits_char_layer(::boost::re_deta
|
||||
std::string cat_name(w32_regex_traits<charT>::get_catalog_name());
|
||||
if(cat_name.size())
|
||||
{
|
||||
cat = ::boost::re_detail::w32_cat_open(cat_name);
|
||||
cat = ::boost::BOOST_REGEX_DETAIL_NS::w32_cat_open(cat_name);
|
||||
if(!cat)
|
||||
{
|
||||
std::string m("Unable to open message catalog: ");
|
||||
std::runtime_error err(m + cat_name);
|
||||
boost::re_detail::raise_runtime_error(err);
|
||||
boost::BOOST_REGEX_DETAIL_NS::raise_runtime_error(err);
|
||||
}
|
||||
}
|
||||
//
|
||||
@@ -210,7 +212,7 @@ w32_regex_traits_char_layer<charT>::w32_regex_traits_char_layer(::boost::re_deta
|
||||
{
|
||||
for(regex_constants::syntax_type i = 1; i < regex_constants::syntax_max; ++i)
|
||||
{
|
||||
string_type mss = ::boost::re_detail::w32_cat_get(cat, this->m_locale, i, get_default_message(i));
|
||||
string_type mss = ::boost::BOOST_REGEX_DETAIL_NS::w32_cat_get(cat, this->m_locale, i, get_default_message(i));
|
||||
for(typename string_type::size_type j = 0; j < mss.size(); ++j)
|
||||
{
|
||||
this->m_char_map[mss[j]] = i;
|
||||
@@ -253,7 +255,7 @@ class BOOST_REGEX_DECL w32_regex_traits_char_layer<char> : public w32_regex_trai
|
||||
{
|
||||
typedef std::string string_type;
|
||||
public:
|
||||
w32_regex_traits_char_layer(::boost::re_detail::lcid_type l)
|
||||
w32_regex_traits_char_layer(::boost::BOOST_REGEX_DETAIL_NS::lcid_type l)
|
||||
: w32_regex_traits_base<char>(l)
|
||||
{
|
||||
init();
|
||||
@@ -300,7 +302,7 @@ public:
|
||||
|
||||
typedef std::basic_string<charT> string_type;
|
||||
typedef charT char_type;
|
||||
w32_regex_traits_implementation(::boost::re_detail::lcid_type l);
|
||||
w32_regex_traits_implementation(::boost::BOOST_REGEX_DETAIL_NS::lcid_type l);
|
||||
std::string error_string(regex_constants::error_type n) const
|
||||
{
|
||||
if(!m_error_strings.empty())
|
||||
@@ -327,7 +329,7 @@ public:
|
||||
string_type transform_primary(const charT* p1, const charT* p2) const;
|
||||
string_type transform(const charT* p1, const charT* p2) const
|
||||
{
|
||||
return ::boost::re_detail::w32_transform(this->m_locale, p1, p2);
|
||||
return ::boost::BOOST_REGEX_DETAIL_NS::w32_transform(this->m_locale, p1, p2);
|
||||
}
|
||||
private:
|
||||
std::map<int, std::string> m_error_strings; // error messages indexed by numberic ID
|
||||
@@ -430,19 +432,19 @@ typename w32_regex_traits_implementation<charT>::string_type
|
||||
}
|
||||
|
||||
template <class charT>
|
||||
w32_regex_traits_implementation<charT>::w32_regex_traits_implementation(::boost::re_detail::lcid_type l)
|
||||
w32_regex_traits_implementation<charT>::w32_regex_traits_implementation(::boost::BOOST_REGEX_DETAIL_NS::lcid_type l)
|
||||
: w32_regex_traits_char_layer<charT>(l)
|
||||
{
|
||||
cat_type cat;
|
||||
std::string cat_name(w32_regex_traits<charT>::get_catalog_name());
|
||||
if(cat_name.size())
|
||||
{
|
||||
cat = ::boost::re_detail::w32_cat_open(cat_name);
|
||||
cat = ::boost::BOOST_REGEX_DETAIL_NS::w32_cat_open(cat_name);
|
||||
if(!cat)
|
||||
{
|
||||
std::string m("Unable to open message catalog: ");
|
||||
std::runtime_error err(m + cat_name);
|
||||
boost::re_detail::raise_runtime_error(err);
|
||||
boost::BOOST_REGEX_DETAIL_NS::raise_runtime_error(err);
|
||||
}
|
||||
}
|
||||
//
|
||||
@@ -464,7 +466,7 @@ w32_regex_traits_implementation<charT>::w32_regex_traits_implementation(::boost:
|
||||
default_message.append(1, static_cast<charT>(*p));
|
||||
++p;
|
||||
}
|
||||
string_type s = ::boost::re_detail::w32_cat_get(cat, this->m_locale, i+200, default_message);
|
||||
string_type s = ::boost::BOOST_REGEX_DETAIL_NS::w32_cat_get(cat, this->m_locale, i+200, default_message);
|
||||
std::string result;
|
||||
for(std::string::size_type j = 0; j < s.size(); ++j)
|
||||
{
|
||||
@@ -495,7 +497,7 @@ w32_regex_traits_implementation<charT>::w32_regex_traits_implementation(::boost:
|
||||
static const string_type null_string;
|
||||
for(unsigned int j = 0; j <= 13; ++j)
|
||||
{
|
||||
string_type s(::boost::re_detail::w32_cat_get(cat, this->m_locale, j+300, null_string));
|
||||
string_type s(::boost::BOOST_REGEX_DETAIL_NS::w32_cat_get(cat, this->m_locale, j+300, null_string));
|
||||
if(s.size())
|
||||
this->m_custom_class_names[s] = masks[j];
|
||||
}
|
||||
@@ -503,7 +505,7 @@ w32_regex_traits_implementation<charT>::w32_regex_traits_implementation(::boost:
|
||||
//
|
||||
// get the collation format used by m_pcollate:
|
||||
//
|
||||
m_collate_type = re_detail::find_sort_syntax(this, &m_collate_delim);
|
||||
m_collate_type = BOOST_REGEX_DETAIL_NS::find_sort_syntax(this, &m_collate_delim);
|
||||
}
|
||||
|
||||
template <class charT>
|
||||
@@ -542,7 +544,7 @@ typename w32_regex_traits_implementation<charT>::char_class_type
|
||||
if(pos != m_custom_class_names.end())
|
||||
return pos->second;
|
||||
}
|
||||
std::size_t state_id = 1 + re_detail::get_default_class_id(p1, p2);
|
||||
std::size_t state_id = 1 + BOOST_REGEX_DETAIL_NS::get_default_class_id(p1, p2);
|
||||
if(state_id < sizeof(masks) / sizeof(masks[0]))
|
||||
return masks[state_id];
|
||||
return masks[0];
|
||||
@@ -550,13 +552,13 @@ typename w32_regex_traits_implementation<charT>::char_class_type
|
||||
|
||||
|
||||
template <class charT>
|
||||
boost::shared_ptr<const w32_regex_traits_implementation<charT> > create_w32_regex_traits(::boost::re_detail::lcid_type l)
|
||||
boost::shared_ptr<const w32_regex_traits_implementation<charT> > create_w32_regex_traits(::boost::BOOST_REGEX_DETAIL_NS::lcid_type l)
|
||||
{
|
||||
// TODO: create a cache for previously constructed objects.
|
||||
return boost::object_cache< ::boost::re_detail::lcid_type, w32_regex_traits_implementation<charT> >::get(l, 5);
|
||||
return boost::object_cache< ::boost::BOOST_REGEX_DETAIL_NS::lcid_type, w32_regex_traits_implementation<charT> >::get(l, 5);
|
||||
}
|
||||
|
||||
} // re_detail
|
||||
} // BOOST_REGEX_DETAIL_NS
|
||||
|
||||
template <class charT>
|
||||
class w32_regex_traits
|
||||
@@ -565,13 +567,13 @@ public:
|
||||
typedef charT char_type;
|
||||
typedef std::size_t size_type;
|
||||
typedef std::basic_string<char_type> string_type;
|
||||
typedef ::boost::re_detail::lcid_type locale_type;
|
||||
typedef ::boost::BOOST_REGEX_DETAIL_NS::lcid_type locale_type;
|
||||
typedef boost::uint_least32_t char_class_type;
|
||||
|
||||
struct boost_extensions_tag{};
|
||||
|
||||
w32_regex_traits()
|
||||
: m_pimpl(re_detail::create_w32_regex_traits<charT>(::boost::re_detail::w32_get_default_locale()))
|
||||
: m_pimpl(BOOST_REGEX_DETAIL_NS::create_w32_regex_traits<charT>(::boost::BOOST_REGEX_DETAIL_NS::w32_get_default_locale()))
|
||||
{ }
|
||||
static size_type length(const char_type* p)
|
||||
{
|
||||
@@ -603,11 +605,11 @@ public:
|
||||
}
|
||||
charT toupper(charT c) const
|
||||
{
|
||||
return ::boost::re_detail::w32_toupper(c, this->m_pimpl->m_locale);
|
||||
return ::boost::BOOST_REGEX_DETAIL_NS::w32_toupper(c, this->m_pimpl->m_locale);
|
||||
}
|
||||
string_type transform(const charT* p1, const charT* p2) const
|
||||
{
|
||||
return ::boost::re_detail::w32_transform(this->m_pimpl->m_locale, p1, p2);
|
||||
return ::boost::BOOST_REGEX_DETAIL_NS::w32_transform(this->m_pimpl->m_locale, p1, p2);
|
||||
}
|
||||
string_type transform_primary(const charT* p1, const charT* p2) const
|
||||
{
|
||||
@@ -623,34 +625,34 @@ public:
|
||||
}
|
||||
bool isctype(charT c, char_class_type f) const
|
||||
{
|
||||
if((f & re_detail::w32_regex_traits_implementation<charT>::mask_base)
|
||||
&& (this->m_pimpl->isctype(f & re_detail::w32_regex_traits_implementation<charT>::mask_base, c)))
|
||||
if((f & BOOST_REGEX_DETAIL_NS::w32_regex_traits_implementation<charT>::mask_base)
|
||||
&& (this->m_pimpl->isctype(f & BOOST_REGEX_DETAIL_NS::w32_regex_traits_implementation<charT>::mask_base, c)))
|
||||
return true;
|
||||
else if((f & re_detail::w32_regex_traits_implementation<charT>::mask_unicode) && re_detail::is_extended(c))
|
||||
else if((f & BOOST_REGEX_DETAIL_NS::w32_regex_traits_implementation<charT>::mask_unicode) && BOOST_REGEX_DETAIL_NS::is_extended(c))
|
||||
return true;
|
||||
else if((f & re_detail::w32_regex_traits_implementation<charT>::mask_word) && (c == '_'))
|
||||
else if((f & BOOST_REGEX_DETAIL_NS::w32_regex_traits_implementation<charT>::mask_word) && (c == '_'))
|
||||
return true;
|
||||
else if((f & re_detail::w32_regex_traits_implementation<charT>::mask_vertical)
|
||||
&& (::boost::re_detail::is_separator(c) || (c == '\v')))
|
||||
else if((f & BOOST_REGEX_DETAIL_NS::w32_regex_traits_implementation<charT>::mask_vertical)
|
||||
&& (::boost::BOOST_REGEX_DETAIL_NS::is_separator(c) || (c == '\v')))
|
||||
return true;
|
||||
else if((f & re_detail::w32_regex_traits_implementation<charT>::mask_horizontal)
|
||||
&& this->isctype(c, 0x0008u) && !this->isctype(c, re_detail::w32_regex_traits_implementation<charT>::mask_vertical))
|
||||
else if((f & BOOST_REGEX_DETAIL_NS::w32_regex_traits_implementation<charT>::mask_horizontal)
|
||||
&& this->isctype(c, 0x0008u) && !this->isctype(c, BOOST_REGEX_DETAIL_NS::w32_regex_traits_implementation<charT>::mask_vertical))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
int toi(const charT*& p1, const charT* p2, int radix)const
|
||||
{
|
||||
return ::boost::re_detail::global_toi(p1, p2, radix, *this);
|
||||
return ::boost::BOOST_REGEX_DETAIL_NS::global_toi(p1, p2, radix, *this);
|
||||
}
|
||||
int value(charT c, int radix)const
|
||||
{
|
||||
int result = ::boost::re_detail::global_value(c);
|
||||
int result = ::boost::BOOST_REGEX_DETAIL_NS::global_value(c);
|
||||
return result < radix ? result : -1;
|
||||
}
|
||||
locale_type imbue(locale_type l)
|
||||
{
|
||||
::boost::re_detail::lcid_type result(getloc());
|
||||
m_pimpl = re_detail::create_w32_regex_traits<charT>(l);
|
||||
::boost::BOOST_REGEX_DETAIL_NS::lcid_type result(getloc());
|
||||
m_pimpl = BOOST_REGEX_DETAIL_NS::create_w32_regex_traits<charT>(l);
|
||||
return result;
|
||||
}
|
||||
locale_type getloc()const
|
||||
@@ -670,7 +672,7 @@ public:
|
||||
static std::string get_catalog_name();
|
||||
|
||||
private:
|
||||
boost::shared_ptr<const re_detail::w32_regex_traits_implementation<charT> > m_pimpl;
|
||||
boost::shared_ptr<const BOOST_REGEX_DETAIL_NS::w32_regex_traits_implementation<charT> > m_pimpl;
|
||||
//
|
||||
// catalog name handler:
|
||||
//
|
||||
@@ -736,4 +738,6 @@ static_mutex& w32_regex_traits<charT>::get_mutex_inst()
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
||||
#endif // BOOST_REGEX_NO_WIN32_LOCALE
|
||||
|
||||
#endif
|
||||
|
||||
+60
-46
@@ -1,56 +1,70 @@
|
||||
# copyright John Maddock 2003
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# (See accompanying file LICENSE_1_0.txt or copy at
|
||||
# Copyright Daryle Walker, Hubert Holin, John Maddock 2006 - 2007
|
||||
# copyright Paul A. Bristow 2006 - 2010
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# (See accompanying file LICENSE_1_0.txt or copy at
|
||||
# http://www.boost.org/LICENSE_1_0.txt.
|
||||
# \math_toolkit\libs\math\test\jamfile.v2
|
||||
# Runs all math toolkit tests, functions & distributions,
|
||||
# and build math examples.
|
||||
|
||||
SOURCES = command_line main time_boost time_greta time_localised_boost time_pcre time_dynamic_xpressive time_posix time_safe_greta ;
|
||||
# bring in the rules for testing
|
||||
import testing ;
|
||||
import modules ;
|
||||
import path ;
|
||||
import pch ;
|
||||
using quickbook ;
|
||||
using auto-index ;
|
||||
|
||||
local HS_REGEX_PATH = [ modules.peek : HS_REGEX_PATH ] ;
|
||||
local USE_POSIX = [ modules.peek : USE_POSIX ] ;
|
||||
local PCRE_PATH = [ modules.peek : PCRE_PATH ] ;
|
||||
local USE_PCRE = [ modules.peek : USE_PCRE ] ;
|
||||
path-constant images_location : html ;
|
||||
path-constant here : . ;
|
||||
|
||||
if $(HS_REGEX_PATH)
|
||||
{
|
||||
HS_SOURCES = $(HS_REGEX_PATH)/regcomp.c $(HS_REGEX_PATH)/regerror.c $(HS_REGEX_PATH)/regexec.c $(HS_REGEX_PATH)/regfree.c ;
|
||||
POSIX_OPTS = <define>BOOST_HAS_POSIX=1 <include>$(HS_REGEX_PATH) ;
|
||||
}
|
||||
else if $(USE_POSIX)
|
||||
{
|
||||
POSIX_OPTS = <define>BOOST_HAS_POSIX=1 ;
|
||||
}
|
||||
lib pcre2 ;
|
||||
lib re2 ;
|
||||
|
||||
lib pcre : : <name>pcre ;
|
||||
exe has_pcre2 : config/pcre.cpp pcre2 : <include>third_party <dll-path>third_party <library-path>third_party release ;
|
||||
explicit has_pcre2 ;
|
||||
exe has_posix : config/posix.cpp : release ;
|
||||
explicit has_posix ;
|
||||
exe has_re2 : config/re2.cpp : release <source>re2 <include>third_party <dll-path>third_party <library-path>third_party ;
|
||||
explicit has_re2 ;
|
||||
|
||||
if $(PCRE_PATH)
|
||||
{
|
||||
PCRE_SOURCES = $(PCRE_PATH)/chartables.c $(PCRE_PATH)/get.c $(PCRE_PATH)/pcre.c $(PCRE_PATH)/study.c ;
|
||||
PCRE_OPTS = <define>BOOST_HAS_PCRE=1 <include>$(PCRE_PATH) ;
|
||||
}
|
||||
else if $(USE_PCRE)
|
||||
{
|
||||
PCRE_OPTS = <define>BOOST_HAS_PCRE=1 ;
|
||||
PCRE_SOURCES = pcre ;
|
||||
}
|
||||
run [ glob *.cpp ] /boost/regex//boost_regex /boost/system /boost/chrono /boost/filesystem
|
||||
: : :
|
||||
release
|
||||
[ check-target-builds has_pcre2 : <define>TEST_PCRE2 <source>pcre2 ]
|
||||
[ check-target-builds has_posix : <define>TEST_POSIX ]
|
||||
[ check-target-builds has_re2 : <define>TEST_RE2 <source>re2 <include>third_party <dll-path>third_party <library-path>third_party ]
|
||||
<include>third_party
|
||||
<dll-path>third_party
|
||||
<library-path>third_party
|
||||
: performance ;
|
||||
|
||||
|
||||
exe regex_comparison :
|
||||
$(SOURCES).cpp
|
||||
$(HS_SOURCES)
|
||||
$(PCRE_SOURCES)
|
||||
../build//boost_regex
|
||||
../../test/build//boost_prg_exec_monitor/<link>static
|
||||
:
|
||||
<define>BOOST_REGEX_NO_LIB=1
|
||||
<define>BOOST_REGEX_STATIC_LINK=1
|
||||
$(POSIX_OPTS)
|
||||
$(PCRE_OPTS)
|
||||
xml report : doc/report.qbk : <dependency>performance ;
|
||||
boostbook standalone
|
||||
:
|
||||
report
|
||||
:
|
||||
# Path for links to Boost:
|
||||
<xsl:param>boost.root=../../../..
|
||||
|
||||
# Some general style settings:
|
||||
<xsl:param>table.footnote.number.format=1
|
||||
<xsl:param>footnote.number.format=1
|
||||
<xsl:param>html.stylesheet=../../../../doc/src/boostbook.css
|
||||
|
||||
# HTML options first:
|
||||
# Use graphics not text for navigation:
|
||||
<xsl:param>navig.graphics=1
|
||||
# How far down we chunk nested sections, basically all of them:
|
||||
<xsl:param>chunk.section.depth=0
|
||||
# Don't put the first section on the same page as the TOC:
|
||||
<xsl:param>chunk.first.sections=0
|
||||
# How far down sections get TOC's
|
||||
<xsl:param>toc.section.depth=2
|
||||
# Max depth in each TOC:
|
||||
<xsl:param>toc.max.depth=4
|
||||
# How far down we go with TOC's
|
||||
<xsl:param>generate.section.toc.level=10
|
||||
;
|
||||
|
||||
|
||||
install . : regex_comparison ;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
///////////////////////////////////////////////////////////////
|
||||
// Copyright 2015 John Maddock. Distributed under the Boost
|
||||
// Software License, Version 1.0. (See accompanying file
|
||||
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_
|
||||
//
|
||||
|
||||
#include "performance.hpp"
|
||||
#include <boost/regex.hpp>
|
||||
#include <boost/version.hpp>
|
||||
#include <boost/lexical_cast.hpp>
|
||||
|
||||
struct boost_regex : public abstract_regex
|
||||
{
|
||||
private:
|
||||
boost::regex e;
|
||||
boost::cmatch what;
|
||||
public:
|
||||
virtual bool set_expression(const char* pe, bool isperl)
|
||||
{
|
||||
e.assign(pe, isperl ? boost::regex::perl : boost::regex::extended);
|
||||
return e.status() == 0;
|
||||
}
|
||||
virtual bool match_test(const char* text);
|
||||
virtual unsigned find_all(const char* text);
|
||||
virtual std::string name();
|
||||
|
||||
struct initializer
|
||||
{
|
||||
initializer()
|
||||
{
|
||||
boost_regex::register_instance(boost::shared_ptr<abstract_regex>(new boost_regex));
|
||||
}
|
||||
void do_nothing()const {}
|
||||
};
|
||||
static const initializer init;
|
||||
};
|
||||
|
||||
const boost_regex::initializer boost_regex::init;
|
||||
|
||||
|
||||
bool boost_regex::match_test(const char * text)
|
||||
{
|
||||
return regex_match(text, what, e);
|
||||
}
|
||||
|
||||
unsigned boost_regex::find_all(const char * text)
|
||||
{
|
||||
boost::regex_iterator<const char*> i(text, text + std::strlen(text), e), j;
|
||||
unsigned count = 0;
|
||||
while(i != j)
|
||||
{
|
||||
++i;
|
||||
++count;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
std::string boost_regex::name()
|
||||
{
|
||||
init.do_nothing();
|
||||
return boost_name();
|
||||
}
|
||||
@@ -1,556 +0,0 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 2002-2003
|
||||
* John Maddock
|
||||
*
|
||||
* Use, modification and distribution are subject to the
|
||||
* Boost Software License, Version 1.0. (See accompanying file
|
||||
* LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
*
|
||||
*/
|
||||
|
||||
#include <iostream>
|
||||
#include <iomanip>
|
||||
#include <fstream>
|
||||
#include <deque>
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
#include <iterator>
|
||||
#include <boost/regex.hpp>
|
||||
#include <boost/version.hpp>
|
||||
#include "regex_comparison.hpp"
|
||||
|
||||
#ifdef BOOST_HAS_PCRE
|
||||
#include "pcre.h" // for pcre version number
|
||||
#endif
|
||||
|
||||
//
|
||||
// globals:
|
||||
//
|
||||
bool time_boost = false;
|
||||
bool time_localised_boost = false;
|
||||
bool time_greta = false;
|
||||
bool time_safe_greta = false;
|
||||
bool time_posix = false;
|
||||
bool time_pcre = false;
|
||||
bool time_xpressive = false;
|
||||
bool time_std = false;
|
||||
|
||||
bool test_matches = false;
|
||||
bool test_code = false;
|
||||
bool test_html = false;
|
||||
bool test_short_twain = false;
|
||||
bool test_long_twain = false;
|
||||
|
||||
|
||||
std::string html_template_file;
|
||||
std::string html_out_file;
|
||||
std::string html_contents;
|
||||
std::list<results> result_list;
|
||||
|
||||
// the following let us compute averages:
|
||||
double greta_total = 0;
|
||||
double safe_greta_total = 0;
|
||||
double boost_total = 0;
|
||||
double locale_boost_total = 0;
|
||||
double posix_total = 0;
|
||||
double pcre_total = 0;
|
||||
double xpressive_total = 0;
|
||||
double std_total = 0;
|
||||
unsigned greta_test_count = 0;
|
||||
unsigned safe_greta_test_count = 0;
|
||||
unsigned boost_test_count = 0;
|
||||
unsigned locale_boost_test_count = 0;
|
||||
unsigned posix_test_count = 0;
|
||||
unsigned pcre_test_count = 0;
|
||||
unsigned xpressive_test_count = 0;
|
||||
unsigned std_test_count = 0;
|
||||
|
||||
int handle_argument(const std::string& what)
|
||||
{
|
||||
if(what == "-b")
|
||||
time_boost = true;
|
||||
else if(what == "-bl")
|
||||
time_localised_boost = true;
|
||||
#ifdef BOOST_HAS_GRETA
|
||||
else if(what == "-g")
|
||||
time_greta = true;
|
||||
else if(what == "-gs")
|
||||
time_safe_greta = true;
|
||||
#endif
|
||||
#ifdef BOOST_HAS_POSIX
|
||||
else if(what == "-posix")
|
||||
time_posix = true;
|
||||
#endif
|
||||
#ifdef BOOST_HAS_PCRE
|
||||
else if(what == "-pcre")
|
||||
time_pcre = true;
|
||||
#endif
|
||||
#ifdef BOOST_HAS_XPRESSIVE
|
||||
else if(what == "-xpressive" || what == "-dxpr")
|
||||
time_xpressive = true;
|
||||
#endif
|
||||
#ifndef BOOST_NO_CXX11_HDR_REGEX
|
||||
else if(what == "-std")
|
||||
time_std = true;
|
||||
#endif
|
||||
else if(what == "-all")
|
||||
{
|
||||
time_boost = true;
|
||||
time_localised_boost = true;
|
||||
#ifdef BOOST_HAS_GRETA
|
||||
time_greta = true;
|
||||
time_safe_greta = true;
|
||||
#endif
|
||||
#ifdef BOOST_HAS_POSIX
|
||||
time_posix = true;
|
||||
#endif
|
||||
#ifdef BOOST_HAS_PCRE
|
||||
time_pcre = true;
|
||||
#endif
|
||||
#ifdef BOOST_HAS_XPRESSIVE
|
||||
time_xpressive = true;
|
||||
#endif
|
||||
#ifndef BOOST_NO_CXX11_HDR_REGEX
|
||||
time_std = true;
|
||||
#endif
|
||||
}
|
||||
else if(what == "-test-matches")
|
||||
test_matches = true;
|
||||
else if(what == "-test-code")
|
||||
test_code = true;
|
||||
else if(what == "-test-html")
|
||||
test_html = true;
|
||||
else if(what == "-test-short-twain")
|
||||
test_short_twain = true;
|
||||
else if(what == "-test-long-twain")
|
||||
test_long_twain = true;
|
||||
else if(what == "-test-all")
|
||||
{
|
||||
test_matches = true;
|
||||
test_code = true;
|
||||
test_html = true;
|
||||
test_short_twain = true;
|
||||
test_long_twain = true;
|
||||
}
|
||||
else if((what == "-h") || (what == "--help"))
|
||||
return show_usage();
|
||||
else if((what[0] == '-') || (what[0] == '/'))
|
||||
{
|
||||
std::cerr << "Unknown argument: \"" << what << "\"" << std::endl;
|
||||
return 1;
|
||||
}
|
||||
else if(html_template_file.size() == 0)
|
||||
{
|
||||
html_template_file = what;
|
||||
load_file(html_contents, what.c_str());
|
||||
}
|
||||
else if(html_out_file.size() == 0)
|
||||
html_out_file = what;
|
||||
else
|
||||
{
|
||||
std::cerr << "Unexpected argument: \"" << what << "\"" << std::endl;
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int show_usage()
|
||||
{
|
||||
std::cout <<
|
||||
"Usage\n"
|
||||
"regex_comparison [-h] [library options] [test options] [html_template html_output_file]\n"
|
||||
" -h Show help\n\n"
|
||||
" library options:\n"
|
||||
" -b Apply tests to boost library\n"
|
||||
" -bl Apply tests to boost library with C++ locale\n"
|
||||
#ifdef BOOST_HAS_GRETA
|
||||
" -g Apply tests to GRETA library\n"
|
||||
" -gs Apply tests to GRETA library (in non-recursive mode)\n"
|
||||
#endif
|
||||
#ifdef BOOST_HAS_POSIX
|
||||
" -posix Apply tests to POSIX library\n"
|
||||
#endif
|
||||
#ifdef BOOST_HAS_PCRE
|
||||
" -pcre Apply tests to PCRE library\n"
|
||||
#endif
|
||||
#ifdef BOOST_HAS_XPRESSIVE
|
||||
" -dxpr Apply tests to dynamic xpressive library\n"
|
||||
#endif
|
||||
#ifndef BOOST_NO_CXX11_HDR_REGEX
|
||||
" -std Apply tests to std::regex.\n"
|
||||
#endif
|
||||
" -all Apply tests to all libraries\n\n"
|
||||
" test options:\n"
|
||||
" -test-matches Test short matches\n"
|
||||
" -test-code Test c++ code examples\n"
|
||||
" -test-html Test c++ code examples\n"
|
||||
" -test-short-twain Test short searches\n"
|
||||
" -test-long-twain Test long searches\n"
|
||||
" -test-all Test everthing\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
void load_file(std::string& text, const char* file)
|
||||
{
|
||||
std::deque<char> temp_copy;
|
||||
std::ifstream is(file);
|
||||
if(!is.good())
|
||||
{
|
||||
std::string msg("Unable to open file: \"");
|
||||
msg.append(file);
|
||||
msg.append("\"");
|
||||
throw std::runtime_error(msg);
|
||||
}
|
||||
is.seekg(0, std::ios_base::end);
|
||||
std::istream::pos_type pos = is.tellg();
|
||||
is.seekg(0, std::ios_base::beg);
|
||||
text.erase();
|
||||
text.reserve(pos);
|
||||
std::istreambuf_iterator<char> it(is);
|
||||
std::copy(it, std::istreambuf_iterator<char>(), std::back_inserter(text));
|
||||
}
|
||||
|
||||
void print_result(std::ostream& os, double time, double best)
|
||||
{
|
||||
static const char* suffixes[] = {"s", "ms", "us", "ns", "ps", };
|
||||
|
||||
if(time < 0)
|
||||
{
|
||||
os << "<td>NA</td>";
|
||||
return;
|
||||
}
|
||||
double rel = time / best;
|
||||
bool highlight = ((rel > 0) && (rel < 1.1));
|
||||
unsigned suffix = 0;
|
||||
while(time < 0)
|
||||
{
|
||||
time *= 1000;
|
||||
++suffix;
|
||||
}
|
||||
os << "<td>";
|
||||
if(highlight)
|
||||
os << "<font color=\"#008000\">";
|
||||
if(rel <= 1000)
|
||||
os << std::setprecision(3) << rel;
|
||||
else
|
||||
os << (int)rel;
|
||||
os << "<BR>(";
|
||||
if(time <= 1000)
|
||||
os << std::setprecision(3) << time;
|
||||
else
|
||||
os << (int)time;
|
||||
os << suffixes[suffix] << ")";
|
||||
if(highlight)
|
||||
os << "</font>";
|
||||
os << "</td>";
|
||||
}
|
||||
|
||||
std::string html_quote(const std::string& in)
|
||||
{
|
||||
static const boost::regex e("(<)|(>)|(&)|(\")");
|
||||
static const std::string format("(?1<)(?2>)(?3&)(?4")");
|
||||
return regex_replace(in, e, format, boost::match_default | boost::format_all);
|
||||
}
|
||||
|
||||
void output_html_results(bool show_description, const std::string& tagname)
|
||||
{
|
||||
std::stringstream os;
|
||||
if(result_list.size())
|
||||
{
|
||||
//
|
||||
// start by outputting the table header:
|
||||
//
|
||||
os << "<table border=\"1\" cellspacing=\"1\">\n";
|
||||
os << "<tr><td><strong>Expression</strong></td>";
|
||||
if(show_description)
|
||||
os << "<td><strong>Text</strong></td>";
|
||||
#if defined(BOOST_HAS_GRETA)
|
||||
if(time_greta == true)
|
||||
os << "<td><strong>GRETA</strong></td>";
|
||||
if(time_safe_greta == true)
|
||||
os << "<td><strong>GRETA<BR>(non-recursive mode)</strong></td>";
|
||||
#endif
|
||||
if(time_boost == true)
|
||||
os << "<td><strong>Boost</strong></td>";
|
||||
if(time_localised_boost == true)
|
||||
os << "<td><strong>Boost + C++ locale</strong></td>";
|
||||
#if defined(BOOST_HAS_POSIX)
|
||||
if(time_posix == true)
|
||||
os << "<td><strong>POSIX</strong></td>";
|
||||
#endif
|
||||
#ifdef BOOST_HAS_PCRE
|
||||
if(time_pcre == true)
|
||||
os << "<td><strong>PCRE</strong></td>";
|
||||
#endif
|
||||
#ifdef BOOST_HAS_XPRESSIVE
|
||||
if(time_xpressive == true)
|
||||
os << "<td><strong>Dynamic Xpressive</strong></td>";
|
||||
#endif
|
||||
#ifndef BOOST_NO_CXX11_HDR_REGEX
|
||||
if(time_std == true)
|
||||
os << "<td><strong>std::regex</strong></td>";
|
||||
#endif
|
||||
os << "</tr>\n";
|
||||
|
||||
//
|
||||
// Now enumerate through all the test results:
|
||||
//
|
||||
std::list<results>::const_iterator first, last;
|
||||
first = result_list.begin();
|
||||
last = result_list.end();
|
||||
while(first != last)
|
||||
{
|
||||
os << "<tr><td><code>" << html_quote(first->expression) << "</code></td>";
|
||||
if(show_description)
|
||||
os << "<td>" << html_quote(first->description) << "</td>";
|
||||
#if defined(BOOST_HAS_GRETA)
|
||||
if(time_greta == true)
|
||||
{
|
||||
print_result(os, first->greta_time, first->factor);
|
||||
if(first->greta_time > 0)
|
||||
{
|
||||
greta_total += first->greta_time / first->factor;
|
||||
++greta_test_count;
|
||||
}
|
||||
}
|
||||
if(time_safe_greta == true)
|
||||
{
|
||||
print_result(os, first->safe_greta_time, first->factor);
|
||||
if(first->safe_greta_time > 0)
|
||||
{
|
||||
safe_greta_total += first->safe_greta_time / first->factor;
|
||||
++safe_greta_test_count;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if(time_boost == true)
|
||||
{
|
||||
print_result(os, first->boost_time, first->factor);
|
||||
if(first->boost_time > 0)
|
||||
{
|
||||
boost_total += first->boost_time / first->factor;
|
||||
++boost_test_count;
|
||||
}
|
||||
}
|
||||
if(time_localised_boost == true)
|
||||
{
|
||||
print_result(os, first->localised_boost_time, first->factor);
|
||||
if(first->localised_boost_time > 0)
|
||||
{
|
||||
locale_boost_total += first->localised_boost_time / first->factor;
|
||||
++locale_boost_test_count;
|
||||
}
|
||||
}
|
||||
if(time_posix == true)
|
||||
{
|
||||
print_result(os, first->posix_time, first->factor);
|
||||
if(first->posix_time > 0)
|
||||
{
|
||||
posix_total += first->posix_time / first->factor;
|
||||
++posix_test_count;
|
||||
}
|
||||
}
|
||||
#if defined(BOOST_HAS_PCRE)
|
||||
if(time_pcre == true)
|
||||
{
|
||||
print_result(os, first->pcre_time, first->factor);
|
||||
if(first->pcre_time > 0)
|
||||
{
|
||||
pcre_total += first->pcre_time / first->factor;
|
||||
++pcre_test_count;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#if defined(BOOST_HAS_XPRESSIVE)
|
||||
if(time_xpressive == true)
|
||||
{
|
||||
print_result(os, first->xpressive_time, first->factor);
|
||||
if(first->xpressive_time > 0)
|
||||
{
|
||||
xpressive_total += first->xpressive_time / first->factor;
|
||||
++xpressive_test_count;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#ifndef BOOST_NO_CXX11_HDR_REGEX
|
||||
if(time_std == true)
|
||||
{
|
||||
print_result(os, first->std_time, first->factor);
|
||||
if(first->std_time > 0)
|
||||
{
|
||||
std_total += first->std_time / first->factor;
|
||||
++std_test_count;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
os << "</tr>\n";
|
||||
++first;
|
||||
}
|
||||
os << "</table>\n";
|
||||
result_list.clear();
|
||||
}
|
||||
else
|
||||
{
|
||||
os << "<P><I>Results not available...</I></P>\n";
|
||||
}
|
||||
|
||||
std::string result = os.str();
|
||||
|
||||
std::string::size_type pos = html_contents.find(tagname);
|
||||
if(pos != std::string::npos)
|
||||
{
|
||||
html_contents.replace(pos, tagname.size(), result);
|
||||
}
|
||||
}
|
||||
|
||||
std::string get_boost_version()
|
||||
{
|
||||
std::stringstream os;
|
||||
os << (BOOST_VERSION / 100000) << '.' << ((BOOST_VERSION / 100) % 1000) << '.' << (BOOST_VERSION % 100);
|
||||
return os.str();
|
||||
}
|
||||
|
||||
std::string get_averages_table()
|
||||
{
|
||||
std::stringstream os;
|
||||
//
|
||||
// start by outputting the table header:
|
||||
//
|
||||
os << "<table border=\"1\" cellspacing=\"1\">\n";
|
||||
os << "<tr>";
|
||||
#if defined(BOOST_HAS_GRETA)
|
||||
if(time_greta == true)
|
||||
{
|
||||
os << "<td><strong>GRETA</strong></td>";
|
||||
}
|
||||
if(time_safe_greta == true)
|
||||
{
|
||||
os << "<td><strong>GRETA<BR>(non-recursive mode)</strong></td>";
|
||||
}
|
||||
|
||||
#endif
|
||||
if(time_boost == true)
|
||||
{
|
||||
os << "<td><strong>Boost</strong></td>";
|
||||
}
|
||||
if(time_localised_boost == true)
|
||||
{
|
||||
os << "<td><strong>Boost + C++ locale</strong></td>";
|
||||
}
|
||||
#if defined(BOOST_HAS_POSIX)
|
||||
if(time_posix == true)
|
||||
{
|
||||
os << "<td><strong>POSIX</strong></td>";
|
||||
}
|
||||
#endif
|
||||
#ifdef BOOST_HAS_PCRE
|
||||
if(time_pcre == true)
|
||||
{
|
||||
os << "<td><strong>PCRE</strong></td>";
|
||||
}
|
||||
#endif
|
||||
#ifdef BOOST_HAS_XPRESSIVE
|
||||
if(time_xpressive == true)
|
||||
{
|
||||
os << "<td><strong>Dynamic Xpressive</strong></td>";
|
||||
}
|
||||
#endif
|
||||
#ifndef BOOST_NO_CXX11_HDR_REGEX
|
||||
if(time_std == true)
|
||||
{
|
||||
os << "<td><strong>std::regex</strong></td>";
|
||||
}
|
||||
#endif
|
||||
os << "</tr>\n";
|
||||
|
||||
//
|
||||
// Now enumerate through all averages:
|
||||
//
|
||||
os << "<tr>";
|
||||
#if defined(BOOST_HAS_GRETA)
|
||||
if(time_greta == true)
|
||||
os << "<td>" << (greta_total / greta_test_count) << "</td>\n";
|
||||
if(time_safe_greta == true)
|
||||
os << "<td>" << (safe_greta_total / safe_greta_test_count) << "</td>\n";
|
||||
#endif
|
||||
#if defined(BOOST_HAS_POSIX)
|
||||
if(time_boost == true)
|
||||
os << "<td>" << (boost_total / boost_test_count) << "</td>\n";
|
||||
#endif
|
||||
if(time_boost == true)
|
||||
os << "<td>" << (boost_total / boost_test_count) << "</td>\n";
|
||||
if(time_localised_boost == true)
|
||||
os << "<td>" << (locale_boost_total / locale_boost_test_count) << "</td>\n";
|
||||
if(time_posix == true)
|
||||
os << "<td>" << (posix_total / posix_test_count) << "</td>\n";
|
||||
#if defined(BOOST_HAS_PCRE)
|
||||
if(time_pcre == true)
|
||||
os << "<td>" << (pcre_total / pcre_test_count) << "</td>\n";
|
||||
#endif
|
||||
#if defined(BOOST_HAS_XPRESSIVE)
|
||||
if(time_xpressive == true)
|
||||
os << "<td>" << (xpressive_total / xpressive_test_count) << "</td>\n";
|
||||
#endif
|
||||
#ifndef BOOST_NO_CXX11_HDR_REGEX
|
||||
if(time_std == true)
|
||||
os << "<td>" << (std_total / std_test_count) << "</td>\n";
|
||||
#endif
|
||||
os << "</tr>\n";
|
||||
os << "</table>\n";
|
||||
return os.str();
|
||||
}
|
||||
|
||||
void output_final_html()
|
||||
{
|
||||
if(html_out_file.size())
|
||||
{
|
||||
//
|
||||
// start with search and replace ops:
|
||||
//
|
||||
std::string::size_type pos;
|
||||
pos = html_contents.find("%compiler%");
|
||||
if(pos != std::string::npos)
|
||||
{
|
||||
html_contents.replace(pos, 10, BOOST_COMPILER);
|
||||
}
|
||||
pos = html_contents.find("%library%");
|
||||
if(pos != std::string::npos)
|
||||
{
|
||||
html_contents.replace(pos, 9, BOOST_STDLIB);
|
||||
}
|
||||
pos = html_contents.find("%os%");
|
||||
if(pos != std::string::npos)
|
||||
{
|
||||
html_contents.replace(pos, 4, BOOST_PLATFORM);
|
||||
}
|
||||
pos = html_contents.find("%boost%");
|
||||
if(pos != std::string::npos)
|
||||
{
|
||||
html_contents.replace(pos, 7, get_boost_version());
|
||||
}
|
||||
pos = html_contents.find("%pcre%");
|
||||
if(pos != std::string::npos)
|
||||
{
|
||||
#ifdef PCRE_MINOR
|
||||
html_contents.replace(pos, 6, BOOST_STRINGIZE(PCRE_MAJOR.PCRE_MINOR));
|
||||
#else
|
||||
html_contents.replace(pos, 6, "N/A");
|
||||
#endif
|
||||
}
|
||||
pos = html_contents.find("%averages%");
|
||||
if(pos != std::string::npos)
|
||||
{
|
||||
html_contents.replace(pos, 10, get_averages_table());
|
||||
}
|
||||
//
|
||||
// now right the output to file:
|
||||
//
|
||||
std::ofstream os(html_out_file.c_str());
|
||||
os << html_contents;
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout << html_contents;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
///////////////////////////////////////////////////////////////
|
||||
// Copyright 2015 John Maddock. Distributed under the Boost
|
||||
// Software License, Version 1.0. (See accompanying file
|
||||
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_
|
||||
//
|
||||
|
||||
#define PCRE2_STATIC
|
||||
#define PCRE2_CODE_UNIT_WIDTH 8
|
||||
|
||||
#include <pcre2.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
pcre2_match_data* pdata = pcre2_match_data_create(30, NULL);
|
||||
pcre2_match_data_free(pdata);
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
///////////////////////////////////////////////////////////////
|
||||
// Copyright 2015 John Maddock. Distributed under the Boost
|
||||
// Software License, Version 1.0. (See accompanying file
|
||||
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_
|
||||
//
|
||||
|
||||
#include <regex.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
regex_t pe;
|
||||
int r = regcomp(&pe, "foo", REG_EXTENDED);
|
||||
regfree(&pe);
|
||||
return r;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
///////////////////////////////////////////////////////////////
|
||||
// Copyright 2015 John Maddock. Distributed under the Boost
|
||||
// Software License, Version 1.0. (See accompanying file
|
||||
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_
|
||||
//
|
||||
|
||||
#include <re2.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
return re2::RE2::FullMatch("a", "a") ? 0 : 1;
|
||||
}
|
||||
@@ -0,0 +1,212 @@
|
||||
|
||||
|
||||
[/tables:]
|
||||
[template table_Testing_Perl_searches_platform_linux_compiler_GNU_C_version_5_1_0_[]
|
||||
[table:table_Testing_Perl_searches_platform_linux_compiler_GNU_C_version_5_1_0_ Testing Perl searches (platform = linux, compiler = GNU C++ version 5.1.0)
|
||||
[[Expression[br]Text][std::regex][boost 1.59][boost::xpressive::cregex][PCRE-10.10]]
|
||||
[[[^(?i)<a\u005B\^>\u005D+href\=("\u005B\^"\u005D\*"|\u005B\^\u005B:space:\u005D\u005D+)\u005B\^>\u005D\*>][br]In file: ../../../libs/libraries.htm][[role grey -]][[role blue 1.44[br](340578ns)]][[role blue 1.49[br](354327ns)]][[role green 1.00[br](237126ns)]]]
|
||||
[[[^(?i)<font\u005B\^>\u005D+face\=("\u005B\^"\u005D\*"|\u005B\^\u005B:space:\u005D\u005D+)\u005B\^>\u005D\*>.\*?<\/font>][br]In file: ../../../libs/libraries.htm][[role grey -]][[role blue 2.19[br](160902ns)]][[role blue 1.21[br](89265ns)]][[role green 1.00[br](73565ns)]]]
|
||||
[[[^(?i)<h\u005B12345678\u005D\u005B\^>\u005D\*>.\*?<\/h\u005B12345678\u005D>][br]In file: ../../../libs/libraries.htm][[role grey -]][[role blue 1.90[br](161009ns)]][[role blue 2.30[br](194911ns)]][[role green 1.00[br](84846ns)]]]
|
||||
[[[^(?i)<img\u005B\^>\u005D+src\=("\u005B\^"\u005D\*"|\u005B\^\u005B:space:\u005D\u005D+)\u005B\^>\u005D\*>][br]In file: ../../../libs/libraries.htm][[role grey -]][[role blue 2.27[br](164055ns)]][[role blue 1.38[br](100267ns)]][[role green 1.00[br](72402ns)]]]
|
||||
[[[^(?i)<p>.\*?<\/p>][br]In file: ../../../libs/libraries.htm][[role grey -]][[role blue 2.14[br](160542ns)]][[role blue 1.72[br](129220ns)]][[role green 1.00[br](75127ns)]]]
|
||||
[[[^(\\w+)\\s\*(\\(\u005B\^()\u005D++(?:(?2)\u005B\^()\u005D++)\*+\u005B\^)\u005D\*\\))\\s\*(\\{\u005B\^{}\u005D++((?3)\u005B\^{}\u005D++)\*+\u005B\^}\u005D\*+\\})][br]In file: boost/multiprecision/number.hpp][[role grey -]][[role green 1.00[br](1136822ns)]][[role grey -]][[role blue 2.55[br](2896286ns)]]]
|
||||
[[[^(\^\u005B \\t\u005D\*\#(?:(?>\u005B\^\\\\\\n\u005D+)|\\\\(?>\\s\*\\n|.))\*)|][br]In file: boost/multiprecision/number.hpp][[role grey -]][[role blue 1.88[br](11915857ns)]][[role green 1.14[br](7206389ns)]][[role green 1.00[br](6347410ns)]]]
|
||||
[[[^(template\u005B\u005B:space:\u005D\u005D\*<\u005B\^;:{\u005D+>\u005B\u005B:space:\u005D\u005D\*)?(class|struct)\u005B\u005B:space:\u005D\u005D\*(\\w+(\u005B \u005D\*\\(\u005B\^)\u005D\*\\))?\u005B\u0 ...][br]In file: boost/multiprecision/number.hpp][[role blue 3.55[br](20770292ns)]][[role blue 1.78[br](10395642ns)]][[role green 1.00[br](5856680ns)]][[role blue 1.84[br](10752084ns)]]]
|
||||
[[[^Beman|John|Dave][br]In file: ../../../libs/libraries.htm][[role red 33.79[br](2157684ns)]][[role green 1.00[br](63861ns)]][[role green 1.13[br](72354ns)]][[role green 1.15[br](73190ns)]]]
|
||||
[[[^\\w+\\s\*(\\(\u005B\^()\u005D++(?:(?1)\u005B\^()\u005D++)\*+\u005B\^)\u005D\*\\))][br]In file: boost/multiprecision/number.hpp][[role grey -]][[role green 1.00[br](1167674ns)]][[role grey -]][[role blue 1.47[br](1710795ns)]]]
|
||||
[[[^\\{\u005B\^{}\u005D++((?0)\u005B\^{}\u005D++)\*+\u005B\^}\u005D\*+\\}][br]In file: boost/multiprecision/number.hpp][[role grey -]][[role blue 1.32[br](150540ns)]][[role grey -]][[role green 1.00[br](114132ns)]]]
|
||||
[[[^\^\u005B \u005D\*\#\u005B \u005D\*include\u005B \u005D+("\u005B\^"\u005D+"|<\u005B\^>\u005D+>)][br]In file: boost/multiprecision/number.hpp][[role red 10.62[br](1269946ns)]][[role blue 1.43[br](171067ns)]][[role green 1.00[br](119573ns)]][[role blue 1.35[br](161102ns)]]]
|
||||
[[[^\^\u005B \u005D\*\#\u005B \u005D\*include\u005B \u005D+("boost\/\u005B\^"\u005D+"|<boost\/\u005B\^>\u005D+>)][br]In file: boost/multiprecision/number.hpp][[role red 10.59[br](1271338ns)]][[role blue 1.44[br](173240ns)]][[role green 1.00[br](120003ns)]][[role blue 1.34[br](160962ns)]]]
|
||||
]
|
||||
]
|
||||
|
||||
[template table_Testing_leftmost_longest_searches_platform_linux_compiler_GNU_C_version_5_1_0_[]
|
||||
[table:table_Testing_leftmost_longest_searches_platform_linux_compiler_GNU_C_version_5_1_0_ Testing leftmost-longest searches (platform = linux, compiler = GNU C++ version 5.1.0)
|
||||
[[Expression[br]Text][std::regex][boost 1.59][POSIX]]
|
||||
[[[^<a\u005B\^>\u005D+href\=("\u005B\^"\u005D\*"|\u005B\^\u005B:space:\u005D\u005D+)\u005B\^>\u005D\*>][br]In file: ../../../libs/libraries.htm][[role blue 1.47[br](2329256ns)]][[role green 1.00[br](1583069ns)]][[role blue 2.43[br](3849462ns)]]]
|
||||
[[[^<img\u005B\^>\u005D+src\=("\u005B\^"\u005D\*"|\u005B\^\u005B:space:\u005D\u005D+)\u005B\^>\u005D\*>][br]In file: ../../../libs/libraries.htm][[role red 10.94[br](1129103ns)]][[role green 1.00[br](103241ns)]][[role green 1.01[br](104450ns)]]]
|
||||
[[[^Beman|John|Dave][br]In file: ../../../libs/libraries.htm][[role red 30.21[br](2093732ns)]][[role green 1.00[br](69316ns)]][[role blue 1.32[br](91168ns)]]]
|
||||
]
|
||||
]
|
||||
|
||||
[template table_Testing_simple_Perl_matches_platform_linux_compiler_GNU_C_version_5_1_0_[]
|
||||
[table:table_Testing_simple_Perl_matches_platform_linux_compiler_GNU_C_version_5_1_0_ Testing simple Perl matches (platform = linux, compiler = GNU C++ version 5.1.0)
|
||||
[[Expression[br]Text][std::regex][boost 1.59][boost::xpressive::cregex][PCRE-10.10]]
|
||||
[[[^(\u005B\u005B:digit:\u005D\u005D{4}\u005B- \u005D){3}\u005B\u005B:digit:\u005D\u005D{3,4}][br][^1234-5678-1234-456]][[role blue 2.72[br](384ns)]][[role blue 2.85[br](402ns)]][[role green 1.00[br](141ns)]][[role blue 1.33[br](187ns)]]]
|
||||
[[[^\^(\u005B0-9\u005D+)(\\-| |\$)(.\*)\$][br][^100- this is a line of ftp response which contains a message string]][[role red 19.85[br](2124ns)]][[role blue 2.68[br](287ns)]][[role green 1.00[br](107ns)]][[role blue 2.94[br](315ns)]]]
|
||||
[[[^\^(\u005Ba-zA-Z0-9\_\\-\\.\u005D+)\@((\\\u005B\u005B0-9\u005D{1,3}\\.\u005B0-9\u005D{1,3}\\.\u005B0-9\u005D{1,3}\\.)|((\u005Ba-zA-Z0-9\\-\u005D+\\.)+))(\u005Ba-zA-Z\u005D{2,4}|\u005B0-9\u005D{1,3})(\\ ...][br][^bob.smith\@foo.tv]][[role grey -]][[role blue 2.16[br](542ns)]][[role green 1.00[br](251ns)]][[role blue 1.25[br](315ns)]]]
|
||||
[[[^\^(\u005Ba-zA-Z0-9\_\\-\\.\u005D+)\@((\\\u005B\u005B0-9\u005D{1,3}\\.\u005B0-9\u005D{1,3}\\.\u005B0-9\u005D{1,3}\\.)|((\u005Ba-zA-Z0-9\\-\u005D+\\.)+))(\u005Ba-zA-Z\u005D{2,4}|\u005B0-9\u005D{1,3})(\\ ...][br][^foo12\@foo.edu]][[role grey -]][[role blue 2.22[br](554ns)]][[role green 1.00[br](250ns)]][[role blue 1.28[br](319ns)]]]
|
||||
[[[^\^(\u005Ba-zA-Z0-9\_\\-\\.\u005D+)\@((\\\u005B\u005B0-9\u005D{1,3}\\.\u005B0-9\u005D{1,3}\\.\u005B0-9\u005D{1,3}\\.)|((\u005Ba-zA-Z0-9\\-\u005D+\\.)+))(\u005Ba-zA-Z\u005D{2,4}|\u005B0-9\u005D{1,3})(\\ ...][br][^john\@johnmaddock.co.uk]][[role grey -]][[role blue 2.10[br](657ns)]][[role green 1.00[br](313ns)]][[role green 1.16[br](364ns)]]]
|
||||
[[[^\^\u005B-+\u005D?\u005B\u005B:digit:\u005D\u005D\*\\.?\u005B\u005B:digit:\u005D\u005D\*\$][br][^+3.14159]][[role red 4.08[br](339ns)]][[role blue 2.51[br](208ns)]][[role green 1.00[br](83ns)]][[role blue 1.42[br](118ns)]]]
|
||||
[[[^\^\u005B-+\u005D?\u005B\u005B:digit:\u005D\u005D\*\\.?\u005B\u005B:digit:\u005D\u005D\*\$][br][^-3.14159]][[role red 4.14[br](335ns)]][[role blue 2.49[br](202ns)]][[role green 1.00[br](81ns)]][[role blue 1.46[br](118ns)]]]
|
||||
[[[^\^\u005B-+\u005D?\u005B\u005B:digit:\u005D\u005D\*\\.?\u005B\u005B:digit:\u005D\u005D\*\$][br][^123]][[role blue 3.17[br](254ns)]][[role blue 2.25[br](180ns)]][[role green 1.00[br](80ns)]][[role blue 1.32[br](106ns)]]]
|
||||
[[[^\^\u005B\u005B:digit:\u005D\u005D{1,2}\/\u005B\u005B:digit:\u005D\u005D{1,2}\/\u005B\u005B:digit:\u005D\u005D{4}\$][br][^12\/12\/2001]][[role blue 3.02[br](248ns)]][[role blue 2.52[br](207ns)]][[role green 1.00[br](82ns)]][[role green 1.18[br](97ns)]]]
|
||||
[[[^\^\u005B\u005B:digit:\u005D\u005D{1,2}\/\u005B\u005B:digit:\u005D\u005D{1,2}\/\u005B\u005B:digit:\u005D\u005D{4}\$][br][^4\/1\/2001]][[role blue 2.70[br](216ns)]][[role blue 2.25[br](180ns)]][[role green 1.00[br](80ns)]][[role green 1.18[br](94ns)]]]
|
||||
[[[^\^\u005Ba-zA-Z\u005D{1,2}\u005B0-9\u005D\u005B0-9A-Za-z\u005D{0,1} {0,1}\u005B0-9\u005D\u005BA-Za-z\u005D{2}\$][br][^EH10 2QQ]][[role blue 2.54[br](229ns)]][[role blue 2.39[br](215ns)]][[role green 1.00[br](90ns)]][[role green 1.16[br](104ns)]]]
|
||||
[[[^\^\u005Ba-zA-Z\u005D{1,2}\u005B0-9\u005D\u005B0-9A-Za-z\u005D{0,1} {0,1}\u005B0-9\u005D\u005BA-Za-z\u005D{2}\$][br][^G1 1AA]][[role blue 2.46[br](219ns)]][[role blue 2.39[br](213ns)]][[role green 1.00[br](89ns)]][[role green 1.18[br](105ns)]]]
|
||||
[[[^\^\u005Ba-zA-Z\u005D{1,2}\u005B0-9\u005D\u005B0-9A-Za-z\u005D{0,1} {0,1}\u005B0-9\u005D\u005BA-Za-z\u005D{2}\$][br][^SW1 1ZZ]][[role blue 2.51[br](228ns)]][[role blue 2.31[br](210ns)]][[role green 1.00[br](91ns)]][[role green 1.12[br](102ns)]]]
|
||||
[[[^abc][br][^abc]][[role blue 1.92[br](113ns)]][[role blue 2.12[br](125ns)]][[role green 1.07[br](63ns)]][[role green 1.00[br](59ns)]]]
|
||||
]
|
||||
]
|
||||
|
||||
[template table_Testing_simple_leftmost_longest_matches_platform_linux_compiler_GNU_C_version_5_1_0_[]
|
||||
[table:table_Testing_simple_leftmost_longest_matches_platform_linux_compiler_GNU_C_version_5_1_0_ Testing simple leftmost-longest matches (platform = linux, compiler = GNU C++ version 5.1.0)
|
||||
[[Expression[br]Text][std::regex][boost 1.59][POSIX]]
|
||||
[[[^(\u005B\u005B:digit:\u005D\u005D{4}\u005B- \u005D){3}\u005B\u005B:digit:\u005D\u005D{3,4}][br][^1234-5678-1234-456]][[role green 1.00[br](431ns)]][[role blue 1.25[br](537ns)]][[role blue 3.45[br](1486ns)]]]
|
||||
[[[^\^(\u005B0-9\u005D+)(\\-| |\$)(.\*)\$][br][^100- this is a line of ftp response which contains a message string]][[role red 4.60[br](2203ns)]][[role green 1.00[br](479ns)]][[role red 12.80[br](6133ns)]]]
|
||||
[[[^\^(\u005Ba-zA-Z0-9\_\\-\\.\u005D+)\@((\\\u005B\u005B0-9\u005D{1,3}\\.\u005B0-9\u005D{1,3}\\.\u005B0-9\u005D{1,3}\\.)|((\u005Ba-zA-Z0-9\\-\u005D+\\.)+))(\u005Ba-zA-Z\u005D{2,4}|\u005B0-9\u005D{1,3})(\\ ...][br][^bob.smith\@foo.tv]][[role blue 1.28[br](869ns)]][[role green 1.00[br](681ns)]][[role blue 2.61[br](1775ns)]]]
|
||||
[[[^\^(\u005Ba-zA-Z0-9\_\\-\\.\u005D+)\@((\\\u005B\u005B0-9\u005D{1,3}\\.\u005B0-9\u005D{1,3}\\.\u005B0-9\u005D{1,3}\\.)|((\u005Ba-zA-Z0-9\\-\u005D+\\.)+))(\u005Ba-zA-Z\u005D{2,4}|\u005B0-9\u005D{1,3})(\\ ...][br][^foo12\@foo.edu]][[role green 1.11[br](752ns)]][[role green 1.00[br](675ns)]][[role blue 2.44[br](1644ns)]]]
|
||||
[[[^\^(\u005Ba-zA-Z0-9\_\\-\\.\u005D+)\@((\\\u005B\u005B0-9\u005D{1,3}\\.\u005B0-9\u005D{1,3}\\.\u005B0-9\u005D{1,3}\\.)|((\u005Ba-zA-Z0-9\\-\u005D+\\.)+))(\u005Ba-zA-Z\u005D{2,4}|\u005B0-9\u005D{1,3})(\\ ...][br][^john\@johnmaddock.co.uk]][[role blue 1.24[br](1116ns)]][[role green 1.00[br](899ns)]][[role blue 2.61[br](2342ns)]]]
|
||||
[[[^\^\u005B-+\u005D?\u005B\u005B:digit:\u005D\u005D\*\\.?\u005B\u005B:digit:\u005D\u005D\*\$][br][^+3.14159]][[role blue 1.61[br](339ns)]][[role blue 1.76[br](370ns)]][[role green 1.00[br](210ns)]]]
|
||||
[[[^\^\u005B-+\u005D?\u005B\u005B:digit:\u005D\u005D\*\\.?\u005B\u005B:digit:\u005D\u005D\*\$][br][^-3.14159]][[role blue 1.66[br](342ns)]][[role blue 1.79[br](368ns)]][[role green 1.00[br](206ns)]]]
|
||||
[[[^\^\u005B-+\u005D?\u005B\u005B:digit:\u005D\u005D\*\\.?\u005B\u005B:digit:\u005D\u005D\*\$][br][^123]][[role blue 1.69[br](248ns)]][[role blue 3.70[br](544ns)]][[role green 1.00[br](147ns)]]]
|
||||
[[[^\^\u005B\u005B:digit:\u005D\u005D{1,2}\/\u005B\u005B:digit:\u005D\u005D{1,2}\/\u005B\u005B:digit:\u005D\u005D{4}\$][br][^12\/12\/2001]][[role blue 2.23[br](256ns)]][[role blue 2.63[br](303ns)]][[role green 1.00[br](115ns)]]]
|
||||
[[[^\^\u005B\u005B:digit:\u005D\u005D{1,2}\/\u005B\u005B:digit:\u005D\u005D{1,2}\/\u005B\u005B:digit:\u005D\u005D{4}\$][br][^4\/1\/2001]][[role blue 1.97[br](213ns)]][[role blue 2.70[br](292ns)]][[role green 1.00[br](108ns)]]]
|
||||
[[[^\^\u005Ba-zA-Z\u005D{1,2}\u005B0-9\u005D\u005B0-9A-Za-z\u005D{0,1} {0,1}\u005B0-9\u005D\u005BA-Za-z\u005D{2}\$][br][^EH10 2QQ]][[role blue 2.38[br](255ns)]][[role blue 3.31[br](354ns)]][[role green 1.00[br](107ns)]]]
|
||||
[[[^\^\u005Ba-zA-Z\u005D{1,2}\u005B0-9\u005D\u005B0-9A-Za-z\u005D{0,1} {0,1}\u005B0-9\u005D\u005BA-Za-z\u005D{2}\$][br][^G1 1AA]][[role blue 2.12[br](216ns)]][[role blue 2.90[br](296ns)]][[role green 1.00[br](102ns)]]]
|
||||
[[[^\^\u005Ba-zA-Z\u005D{1,2}\u005B0-9\u005D\u005B0-9A-Za-z\u005D{0,1} {0,1}\u005B0-9\u005D\u005BA-Za-z\u005D{2}\$][br][^SW1 1ZZ]][[role blue 2.25[br](234ns)]][[role blue 2.89[br](301ns)]][[role green 1.00[br](104ns)]]]
|
||||
[[[^abc][br][^abc]][[role blue 1.20[br](113ns)]][[role blue 2.38[br](224ns)]][[role green 1.00[br](94ns)]]]
|
||||
]
|
||||
]
|
||||
|
||||
[template table_Testing_Perl_searches_platform_Windows_x64_compiler_Microsoft_Visual_C_version_14_0_[]
|
||||
[table:table_Testing_Perl_searches_platform_Windows_x64_compiler_Microsoft_Visual_C_version_14_0_ Testing Perl searches (platform = Windows x64, compiler = Microsoft Visual C++ version 14.0)
|
||||
[[Expression[br]Text][boost 1.60][PCRE-10.10][RE2][std::regex][boost::xpressive::cregex]]
|
||||
[[[^(?i)<a\u005B\^>\u005D+href\=("\u005B\^"\u005D\*"|\u005B\^\u005B:space:\u005D\u005D+)\u005B\^>\u005D\*>][br]In file: ../../../libs/libraries.htm][[role blue 1.26[br](320274ns)]][[role green 1.00[br](253424ns)]][[role blue 1.45[br](366324ns)]][[role grey -]][[role blue 3.00[br](759495ns)]]]
|
||||
[[[^(?i)<font\u005B\^>\u005D+face\=("\u005B\^"\u005D\*"|\u005B\^\u005B:space:\u005D\u005D+)\u005B\^>\u005D\*>.\*?<\/font>][br]In file: ../../../libs/libraries.htm][[role blue 2.94[br](198426ns)]][[role blue 1.28[br](86670ns)]][[role green 1.00[br](67463ns)]][[role grey -]][[role blue 2.92[br](197323ns)]]]
|
||||
[[[^(?i)<h\u005B12345678\u005D\u005B\^>\u005D\*>.\*?<\/h\u005B12345678\u005D>][br]In file: ../../../libs/libraries.htm][[role blue 2.42[br](196304ns)]][[role blue 1.26[br](102129ns)]][[role green 1.00[br](81160ns)]][[role grey -]][[role red 5.12[br](415932ns)]]]
|
||||
[[[^(?i)<img\u005B\^>\u005D+src\=("\u005B\^"\u005D\*"|\u005B\^\u005B:space:\u005D\u005D+)\u005B\^>\u005D\*>][br]In file: ../../../libs/libraries.htm][[role blue 2.87[br](196348ns)]][[role blue 1.28[br](87365ns)]][[role green 1.00[br](68502ns)]][[role grey -]][[role blue 3.25[br](222612ns)]]]
|
||||
[[[^(?i)<p>.\*?<\/p>][br]In file: ../../../libs/libraries.htm][[role blue 2.78[br](194346ns)]][[role blue 1.27[br](88709ns)]][[role green 1.00[br](70020ns)]][[role grey -]][[role red 4.03[br](282425ns)]]]
|
||||
[[[^(\\w+)\\s\*(\\(\u005B\^()\u005D++(?:(?2)\u005B\^()\u005D++)\*+\u005B\^)\u005D\*\\))\\s\*(\\{\u005B\^{}\u005D++((?3)\u005B\^{}\u005D++)\*+\u005B\^}\u005D\*+\\})][br]In file: boost/multiprecision/number.hpp][[role green 1.00[br](1094575ns)]][[role blue 2.87[br](3136734ns)]][[role grey -]][[role grey -]][[role grey -]]]
|
||||
[[[^(\^\u005B \\t\u005D\*\#(?:(?>\u005B\^\\\\\\n\u005D+)|\\\\(?>\\s\*\\n|.))\*)|][br]In file: boost/multiprecision/number.hpp][[role blue 1.92[br](11651545ns)]][[role green 1.00[br](6057879ns)]][[role grey -]][[role grey -]][[role blue 1.55[br](9388319ns)]]]
|
||||
[[[^(template\u005B\u005B:space:\u005D\u005D\*<\u005B\^;:{\u005D+>\u005B\u005B:space:\u005D\u005D\*)?(class|struct)\u005B\u005B:space:\u005D\u005D\*(\\w+(\u005B \u005D\*\\(\u005B\^)\u005D\*\\))?\u005B\u0 ...][br]In file: boost/multiprecision/number.hpp][[role red 29.23[br](8736875ns)]][[role red 38.71[br](11569512ns)]][[role green 1.00[br](298862ns)]][[role red 995.92[br](297642713ns)]][[role red 27.63[br](8258368ns)]]]
|
||||
[[[^Beman|John|Dave][br]In file: ../../../libs/libraries.htm][[role blue 1.60[br](153603ns)]][[role green 1.10[br](105220ns)]][[role blue 2.55[br](244839ns)]][[role red 8.53[br](819095ns)]][[role green 1.00[br](96081ns)]]]
|
||||
[[[^\\w+\\s\*(\\(\u005B\^()\u005D++(?:(?1)\u005B\^()\u005D++)\*+\u005B\^)\u005D\*\\))][br]In file: boost/multiprecision/number.hpp][[role green 1.00[br](1099128ns)]][[role blue 1.66[br](1824126ns)]][[role grey -]][[role grey -]][[role grey -]]]
|
||||
[[[^\\{\u005B\^{}\u005D++((?0)\u005B\^{}\u005D++)\*+\u005B\^}\u005D\*+\\}][br]In file: boost/multiprecision/number.hpp][[role blue 1.60[br](243611ns)]][[role green 1.00[br](152166ns)]][[role grey -]][[role grey -]][[role grey -]]]
|
||||
[[[^\^\u005B \u005D\*\#\u005B \u005D\*include\u005B \u005D+("\u005B\^"\u005D+"|<\u005B\^>\u005D+>)][br]In file: boost/multiprecision/number.hpp][[role blue 1.54[br](260929ns)]][[role green 1.18[br](198707ns)]][[role blue 1.81[br](305923ns)]][[role red 8.53[br](1440180ns)]][[role green 1.00[br](168902ns)]]]
|
||||
[[[^\^\u005B \u005D\*\#\u005B \u005D\*include\u005B \u005D+("boost\/\u005B\^"\u005D+"|<boost\/\u005B\^>\u005D+>)][br]In file: boost/multiprecision/number.hpp][[role blue 1.52[br](256685ns)]][[role green 1.17[br](198358ns)]][[role blue 1.80[br](303602ns)]][[role red 8.51[br](1438197ns)]][[role green 1.00[br](168968ns)]]]
|
||||
]
|
||||
]
|
||||
|
||||
[template table_Testing_leftmost_longest_searches_platform_Windows_x64_compiler_Microsoft_Visual_C_version_14_0_[]
|
||||
[table:table_Testing_leftmost_longest_searches_platform_Windows_x64_compiler_Microsoft_Visual_C_version_14_0_ Testing leftmost-longest searches (platform = Windows x64, compiler = Microsoft Visual C++ version 14.0)
|
||||
[[Expression[br]Text][boost 1.60][std::regex]]
|
||||
[[[^<a\u005B\^>\u005D+href\=("\u005B\^"\u005D\*"|\u005B\^\u005B:space:\u005D\u005D+)\u005B\^>\u005D\*>][br]In file: ../../../libs/libraries.htm][[role green 1.00[br](1518659ns)]][[role red 7.17[br](10890189ns)]]]
|
||||
[[[^<img\u005B\^>\u005D+src\=("\u005B\^"\u005D\*"|\u005B\^\u005B:space:\u005D\u005D+)\u005B\^>\u005D\*>][br]In file: ../../../libs/libraries.htm][[role green 1.00[br](185869ns)]][[role blue 3.77[br](700484ns)]]]
|
||||
[[[^Beman|John|Dave][br]In file: ../../../libs/libraries.htm][[role green 1.00[br](165840ns)]][[role red 4.95[br](820933ns)]]]
|
||||
]
|
||||
]
|
||||
|
||||
[template table_Testing_simple_Perl_matches_platform_Windows_x64_compiler_Microsoft_Visual_C_version_14_0_[]
|
||||
[table:table_Testing_simple_Perl_matches_platform_Windows_x64_compiler_Microsoft_Visual_C_version_14_0_ Testing simple Perl matches (platform = Windows x64, compiler = Microsoft Visual C++ version 14.0)
|
||||
[[Expression[br]Text][boost 1.60][PCRE-10.10][RE2][std::regex][boost::xpressive::cregex]]
|
||||
[[[^(\u005B\u005B:digit:\u005D\u005D{4}\u005B- \u005D){3}\u005B\u005B:digit:\u005D\u005D{3,4}][br][^1234-5678-1234-456]][[role blue 2.03[br](323ns)]][[role blue 1.25[br](198ns)]][[role green 1.00[br](159ns)]][[role red 20.73[br](3296ns)]][[role blue 1.38[br](220ns)]]]
|
||||
[[[^\^(\u005B0-9\u005D+)(\\-| |\$)(.\*)\$][br][^100- this is a line of ftp response which contains a message string]][[role blue 1.71[br](257ns)]][[role blue 2.01[br](302ns)]][[role blue 2.38[br](357ns)]][[role red 30.81[br](4622ns)]][[role green 1.00[br](150ns)]]]
|
||||
[[[^\^(\u005Ba-zA-Z0-9\_\\-\\.\u005D+)\@((\\\u005B\u005B0-9\u005D{1,3}\\.\u005B0-9\u005D{1,3}\\.\u005B0-9\u005D{1,3}\\.)|((\u005Ba-zA-Z0-9\\-\u005D+\\.)+))(\u005Ba-zA-Z\u005D{2,4}|\u005B0-9\u005D{1,3})(\\ ...][br][^bob.smith\@foo.tv]][[role blue 2.66[br](404ns)]][[role blue 2.09[br](317ns)]][[role green 1.00[br](152ns)]][[role red 38.14[br](5798ns)]][[role blue 1.87[br](284ns)]]]
|
||||
[[[^\^(\u005Ba-zA-Z0-9\_\\-\\.\u005D+)\@((\\\u005B\u005B0-9\u005D{1,3}\\.\u005B0-9\u005D{1,3}\\.\u005B0-9\u005D{1,3}\\.)|((\u005Ba-zA-Z0-9\\-\u005D+\\.)+))(\u005Ba-zA-Z\u005D{2,4}|\u005B0-9\u005D{1,3})(\\ ...][br][^foo12\@foo.edu]][[role blue 2.90[br](406ns)]][[role blue 2.31[br](323ns)]][[role green 1.00[br](140ns)]][[role red 41.41[br](5797ns)]][[role blue 2.00[br](280ns)]]]
|
||||
[[[^\^(\u005Ba-zA-Z0-9\_\\-\\.\u005D+)\@((\\\u005B\u005B0-9\u005D{1,3}\\.\u005B0-9\u005D{1,3}\\.\u005B0-9\u005D{1,3}\\.)|((\u005Ba-zA-Z0-9\\-\u005D+\\.)+))(\u005Ba-zA-Z\u005D{2,4}|\u005B0-9\u005D{1,3})(\\ ...][br][^john\@johnmaddock.co.uk]][[role blue 2.74[br](477ns)]][[role blue 2.17[br](378ns)]][[role green 1.00[br](174ns)]][[role red 38.15[br](6638ns)]][[role blue 2.20[br](382ns)]]]
|
||||
[[[^\^\u005B-+\u005D?\u005B\u005B:digit:\u005D\u005D\*\\.?\u005B\u005B:digit:\u005D\u005D\*\$][br][^+3.14159]][[role blue 1.63[br](171ns)]][[role green 1.14[br](120ns)]][[role green 1.13[br](119ns)]][[role red 34.15[br](3586ns)]][[role green 1.00[br](105ns)]]]
|
||||
[[[^\^\u005B-+\u005D?\u005B\u005B:digit:\u005D\u005D\*\\.?\u005B\u005B:digit:\u005D\u005D\*\$][br][^-3.14159]][[role blue 1.69[br](171ns)]][[role green 1.18[br](119ns)]][[role green 1.18[br](119ns)]][[role red 35.54[br](3590ns)]][[role green 1.00[br](101ns)]]]
|
||||
[[[^\^\u005B-+\u005D?\u005B\u005B:digit:\u005D\u005D\*\\.?\u005B\u005B:digit:\u005D\u005D\*\$][br][^123]][[role blue 1.60[br](149ns)]][[role green 1.15[br](107ns)]][[role green 1.10[br](102ns)]][[role red 39.99[br](3719ns)]][[role green 1.00[br](93ns)]]]
|
||||
[[[^\^\u005B\u005B:digit:\u005D\u005D{1,2}\/\u005B\u005B:digit:\u005D\u005D{1,2}\/\u005B\u005B:digit:\u005D\u005D{4}\$][br][^12\/12\/2001]][[role blue 1.65[br](162ns)]][[role green 1.00[br](98ns)]][[role blue 1.31[br](128ns)]][[role red 16.57[br](1624ns)]][[role green 1.03[br](101ns)]]]
|
||||
[[[^\^\u005B\u005B:digit:\u005D\u005D{1,2}\/\u005B\u005B:digit:\u005D\u005D{1,2}\/\u005B\u005B:digit:\u005D\u005D{4}\$][br][^4\/1\/2001]][[role blue 1.58[br](153ns)]][[role green 1.00[br](97ns)]][[role green 1.19[br](115ns)]][[role red 16.54[br](1604ns)]][[role green 1.02[br](99ns)]]]
|
||||
[[[^\^\u005Ba-zA-Z\u005D{1,2}\u005B0-9\u005D\u005B0-9A-Za-z\u005D{0,1} {0,1}\u005B0-9\u005D\u005BA-Za-z\u005D{2}\$][br][^EH10 2QQ]][[role blue 1.57[br](170ns)]][[role green 1.00[br](108ns)]][[role green 1.10[br](119ns)]][[role red 21.83[br](2358ns)]][[role green 1.00[br](108ns)]]]
|
||||
[[[^\^\u005Ba-zA-Z\u005D{1,2}\u005B0-9\u005D\u005B0-9A-Za-z\u005D{0,1} {0,1}\u005B0-9\u005D\u005BA-Za-z\u005D{2}\$][br][^G1 1AA]][[role blue 1.50[br](159ns)]][[role green 1.01[br](107ns)]][[role green 1.05[br](111ns)]][[role red 17.67[br](1873ns)]][[role green 1.00[br](106ns)]]]
|
||||
[[[^\^\u005Ba-zA-Z\u005D{1,2}\u005B0-9\u005D\u005B0-9A-Za-z\u005D{0,1} {0,1}\u005B0-9\u005D\u005BA-Za-z\u005D{2}\$][br][^SW1 1ZZ]][[role blue 1.53[br](164ns)]][[role green 1.00[br](107ns)]][[role green 1.07[br](115ns)]][[role red 18.05[br](1931ns)]][[role green 1.00[br](107ns)]]]
|
||||
[[[^abc][br][^abc]][[role blue 2.10[br](128ns)]][[role green 1.00[br](61ns)]][[role blue 1.30[br](79ns)]][[role red 9.89[br](603ns)]][[role blue 1.25[br](76ns)]]]
|
||||
]
|
||||
]
|
||||
|
||||
|
||||
[template table_Testing_simple_leftmost_longest_matches_platform_Windows_x64_compiler_Microsoft_Visual_C_version_14_0_[]
|
||||
[table:table_Testing_simple_leftmost_longest_matches_platform_Windows_x64_compiler_Microsoft_Visual_C_version_14_0_ Testing simple leftmost-longest matches (platform = Windows x64, compiler = Microsoft Visual C++ version 14.0)
|
||||
[[Expression[br]Text][boost 1.60][std::regex]]
|
||||
[[[^(\u005B\u005B:digit:\u005D\u005D{4}\u005B- \u005D){3}\u005B\u005B:digit:\u005D\u005D{3,4}][br][^1234-5678-1234-456]][[role green 1.00[br](490ns)]][[role red 6.88[br](3372ns)]]]
|
||||
[[[^\^(\u005B0-9\u005D+)(\\-| |\$)(.\*)\$][br][^100- this is a line of ftp response which contains a message string]][[role green 1.00[br](554ns)]][[role grey -]]]
|
||||
[[[^\^(\u005Ba-zA-Z0-9\_\\-\\.\u005D+)\@((\\\u005B\u005B0-9\u005D{1,3}\\.\u005B0-9\u005D{1,3}\\.\u005B0-9\u005D{1,3}\\.)|((\u005Ba-zA-Z0-9\\-\u005D+\\.)+))(\u005Ba-zA-Z\u005D{2,4}|\u005B0-9\u005D{1,3})(\\ ...][br][^bob.smith\@foo.tv]][[role green 1.00[br](614ns)]][[role grey -]]]
|
||||
[[[^\^(\u005Ba-zA-Z0-9\_\\-\\.\u005D+)\@((\\\u005B\u005B0-9\u005D{1,3}\\.\u005B0-9\u005D{1,3}\\.\u005B0-9\u005D{1,3}\\.)|((\u005Ba-zA-Z0-9\\-\u005D+\\.)+))(\u005Ba-zA-Z\u005D{2,4}|\u005B0-9\u005D{1,3})(\\ ...][br][^foo12\@foo.edu]][[role green 1.00[br](596ns)]][[role grey -]]]
|
||||
[[[^\^(\u005Ba-zA-Z0-9\_\\-\\.\u005D+)\@((\\\u005B\u005B0-9\u005D{1,3}\\.\u005B0-9\u005D{1,3}\\.\u005B0-9\u005D{1,3}\\.)|((\u005Ba-zA-Z0-9\\-\u005D+\\.)+))(\u005Ba-zA-Z\u005D{2,4}|\u005B0-9\u005D{1,3})(\\ ...][br][^john\@johnmaddock.co.uk]][[role green 1.00[br](748ns)]][[role grey -]]]
|
||||
[[[^\^\u005B-+\u005D?\u005B\u005B:digit:\u005D\u005D\*\\.?\u005B\u005B:digit:\u005D\u005D\*\$][br][^+3.14159]][[role green 1.00[br](372ns)]][[role red 9.77[br](3635ns)]]]
|
||||
[[[^\^\u005B-+\u005D?\u005B\u005B:digit:\u005D\u005D\*\\.?\u005B\u005B:digit:\u005D\u005D\*\$][br][^-3.14159]][[role green 1.00[br](367ns)]][[role red 9.84[br](3613ns)]]]
|
||||
[[[^\^\u005B-+\u005D?\u005B\u005B:digit:\u005D\u005D\*\\.?\u005B\u005B:digit:\u005D\u005D\*\$][br][^123]][[role green 1.00[br](444ns)]][[role red 8.45[br](3754ns)]]]
|
||||
[[[^\^\u005B\u005B:digit:\u005D\u005D{1,2}\/\u005B\u005B:digit:\u005D\u005D{1,2}\/\u005B\u005B:digit:\u005D\u005D{4}\$][br][^12\/12\/2001]][[role green 1.00[br](325ns)]][[role red 5.19[br](1687ns)]]]
|
||||
[[[^\^\u005B\u005B:digit:\u005D\u005D{1,2}\/\u005B\u005B:digit:\u005D\u005D{1,2}\/\u005B\u005B:digit:\u005D\u005D{4}\$][br][^4\/1\/2001]][[role green 1.00[br](308ns)]][[role red 5.39[br](1660ns)]]]
|
||||
[[[^\^\u005Ba-zA-Z\u005D{1,2}\u005B0-9\u005D\u005B0-9A-Za-z\u005D{0,1} {0,1}\u005B0-9\u005D\u005BA-Za-z\u005D{2}\$][br][^EH10 2QQ]][[role green 1.00[br](356ns)]][[role red 6.78[br](2415ns)]]]
|
||||
[[[^\^\u005Ba-zA-Z\u005D{1,2}\u005B0-9\u005D\u005B0-9A-Za-z\u005D{0,1} {0,1}\u005B0-9\u005D\u005BA-Za-z\u005D{2}\$][br][^G1 1AA]][[role green 1.00[br](315ns)]][[role red 6.14[br](1935ns)]]]
|
||||
[[[^\^\u005Ba-zA-Z\u005D{1,2}\u005B0-9\u005D\u005B0-9A-Za-z\u005D{0,1} {0,1}\u005B0-9\u005D\u005BA-Za-z\u005D{2}\$][br][^SW1 1ZZ]][[role green 1.00[br](346ns)]][[role red 5.68[br](1967ns)]]]
|
||||
[[[^abc][br][^abc]][[role green 1.00[br](287ns)]][[role blue 2.32[br](667ns)]]]
|
||||
]
|
||||
]
|
||||
|
||||
|
||||
[/sections:]
|
||||
[template section_Testing_Perl_searches_platform_linux_compiler_GNU_C_version_5_1_0_[]
|
||||
[section:section_Testing_Perl_searches_platform_linux_compiler_GNU_C_version_5_1_0_ Testing Perl searches (platform = linux, compiler = GNU C++ version 5.1.0)]
|
||||
[table_Testing_Perl_searches_platform_linux_compiler_GNU_C_version_5_1_0_]
|
||||
[endsect]
|
||||
]
|
||||
|
||||
[template section_Testing_leftmost_longest_searches_platform_linux_compiler_GNU_C_version_5_1_0_[]
|
||||
[section:section_Testing_leftmost_longest_searches_platform_linux_compiler_GNU_C_version_5_1_0_ Testing leftmost-longest searches (platform = linux, compiler = GNU C++ version 5.1.0)]
|
||||
[table_Testing_leftmost_longest_searches_platform_linux_compiler_GNU_C_version_5_1_0_]
|
||||
[endsect]
|
||||
]
|
||||
|
||||
[template section_Testing_simple_Perl_matches_platform_linux_compiler_GNU_C_version_5_1_0_[]
|
||||
[section:section_Testing_simple_Perl_matches_platform_linux_compiler_GNU_C_version_5_1_0_ Testing simple Perl matches (platform = linux, compiler = GNU C++ version 5.1.0)]
|
||||
[table_Testing_simple_Perl_matches_platform_linux_compiler_GNU_C_version_5_1_0_]
|
||||
[endsect]
|
||||
]
|
||||
|
||||
[template section_Testing_simple_leftmost_longest_matches_platform_linux_compiler_GNU_C_version_5_1_0_[]
|
||||
[section:section_Testing_simple_leftmost_longest_matches_platform_linux_compiler_GNU_C_version_5_1_0_ Testing simple leftmost-longest matches (platform = linux, compiler = GNU C++ version 5.1.0)]
|
||||
[table_Testing_simple_leftmost_longest_matches_platform_linux_compiler_GNU_C_version_5_1_0_]
|
||||
[endsect]
|
||||
]
|
||||
|
||||
[template section_Testing_Perl_searches_platform_Windows_x64_compiler_Microsoft_Visual_C_version_14_0_[]
|
||||
[section:section_Testing_Perl_searches_platform_Windows_x64_compiler_Microsoft_Visual_C_version_14_0_ Testing Perl searches (platform = Windows x64, compiler = Microsoft Visual C++ version 14.0)]
|
||||
[table_Testing_Perl_searches_platform_Windows_x64_compiler_Microsoft_Visual_C_version_14_0_]
|
||||
[endsect]
|
||||
]
|
||||
|
||||
[template section_Testing_leftmost_longest_searches_platform_Windows_x64_compiler_Microsoft_Visual_C_version_14_0_[]
|
||||
[section:section_Testing_leftmost_longest_searches_platform_Windows_x64_compiler_Microsoft_Visual_C_version_14_0_ Testing leftmost-longest searches (platform = Windows x64, compiler = Microsoft Visual C++ version 14.0)]
|
||||
[table_Testing_leftmost_longest_searches_platform_Windows_x64_compiler_Microsoft_Visual_C_version_14_0_]
|
||||
[endsect]
|
||||
]
|
||||
|
||||
[template section_Testing_simple_Perl_matches_platform_Windows_x64_compiler_Microsoft_Visual_C_version_14_0_[]
|
||||
[section:section_Testing_simple_Perl_matches_platform_Windows_x64_compiler_Microsoft_Visual_C_version_14_0_ Testing simple Perl matches (platform = Windows x64, compiler = Microsoft Visual C++ version 14.0)]
|
||||
[table_Testing_simple_Perl_matches_platform_Windows_x64_compiler_Microsoft_Visual_C_version_14_0_]
|
||||
[endsect]
|
||||
]
|
||||
|
||||
|
||||
[template section_Testing_simple_leftmost_longest_matches_platform_Windows_x64_compiler_Microsoft_Visual_C_version_14_0_[]
|
||||
[section:section_Testing_simple_leftmost_longest_matches_platform_Windows_x64_compiler_Microsoft_Visual_C_version_14_0_ Testing simple leftmost-longest matches (platform = Windows x64, compiler = Microsoft Visual C++ version 14.0)]
|
||||
[table_Testing_simple_leftmost_longest_matches_platform_Windows_x64_compiler_Microsoft_Visual_C_version_14_0_]
|
||||
[endsect]
|
||||
]
|
||||
|
||||
[template performance_all_sections[]
|
||||
[section_Testing_Perl_searches_platform_Windows_x64_compiler_Microsoft_Visual_C_version_14_0_]
|
||||
[section_Testing_Perl_searches_platform_linux_compiler_GNU_C_version_5_1_0_]
|
||||
[section_Testing_leftmost_longest_searches_platform_Windows_x64_compiler_Microsoft_Visual_C_version_14_0_]
|
||||
[section_Testing_leftmost_longest_searches_platform_linux_compiler_GNU_C_version_5_1_0_]
|
||||
[section_Testing_simple_Perl_matches_platform_Windows_x64_compiler_Microsoft_Visual_C_version_14_0_]
|
||||
[section_Testing_simple_Perl_matches_platform_linux_compiler_GNU_C_version_5_1_0_]
|
||||
[section_Testing_simple_leftmost_longest_matches_platform_Windows_x64_compiler_Microsoft_Visual_C_version_14_0_]
|
||||
[section_Testing_simple_leftmost_longest_matches_platform_linux_compiler_GNU_C_version_5_1_0_]
|
||||
]
|
||||
|
||||
[template performance_all_tables[]
|
||||
[table_Testing_Perl_searches_platform_Windows_x64_compiler_Microsoft_Visual_C_version_14_0_]
|
||||
[table_Testing_Perl_searches_platform_linux_compiler_GNU_C_version_5_1_0_]
|
||||
[table_Testing_leftmost_longest_searches_platform_Windows_x64_compiler_Microsoft_Visual_C_version_14_0_]
|
||||
[table_Testing_leftmost_longest_searches_platform_linux_compiler_GNU_C_version_5_1_0_]
|
||||
[table_Testing_simple_Perl_matches_platform_Windows_x64_compiler_Microsoft_Visual_C_version_14_0_]
|
||||
[table_Testing_simple_Perl_matches_platform_linux_compiler_GNU_C_version_5_1_0_]
|
||||
[table_Testing_simple_leftmost_longest_matches_platform_Windows_x64_compiler_Microsoft_Visual_C_version_14_0_]
|
||||
[table_Testing_simple_leftmost_longest_matches_platform_linux_compiler_GNU_C_version_5_1_0_]
|
||||
]
|
||||
@@ -0,0 +1,20 @@
|
||||
[article Boost.Regex Performance Report
|
||||
[quickbook 1.6]
|
||||
[/purpose ISBN 0-9504833-2-X 978-0-9504833-2-0, Classification 519.2-dc22]
|
||||
[license
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
[@http://www.boost.org/LICENSE_1_0.txt])
|
||||
]
|
||||
]
|
||||
|
||||
[import performance_tables.qbk]
|
||||
|
||||
[performance_all_sections]
|
||||
|
||||
[/
|
||||
Copyright 2015 John Maddock and Paul A. Bristow.
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt).
|
||||
]
|
||||
@@ -1,76 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Regular Expression Performance Comparison</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
|
||||
<meta name="Template" content="C:\PROGRAM FILES\MICROSOFT OFFICE\OFFICE\html.dot">
|
||||
<meta name="GENERATOR" content="Microsoft FrontPage Express 2.0">
|
||||
<!-- boostinspect:nounlinked -->
|
||||
</head>
|
||||
<body bgcolor="#ffffff" link="#0000ff" vlink="#800080">
|
||||
<h2>Regular Expression Performance Comparison</h2>
|
||||
<p>
|
||||
The following tables provide comparisons between the following regular
|
||||
expression libraries:</p>
|
||||
<p><a href="http://research.microsoft.com/projects/greta">GRETA</a>.</p>
|
||||
<p><a href="http://www.boost.org/">The Boost regex library</a>.</p>
|
||||
<p><a href="http://arglist.com/regex/">Henry Spencer's regular expression library</a>
|
||||
- this is provided for comparison as a typical non-backtracking implementation.</p>
|
||||
<P>Philip Hazel's <A href="http://www.pcre.org">PCRE</A> library.</P>
|
||||
<H3>Details</H3>
|
||||
<P>Machine: Intel Pentium 4 2.8GHz PC.</P>
|
||||
<P>Compiler: %compiler%.</P>
|
||||
<P>C++ Standard Library: %library%.</P>
|
||||
<P>OS: %os%.</P>
|
||||
<P>Boost version: %boost%.</P>
|
||||
<P>PCRE version: %pcre%.</P>
|
||||
<P>
|
||||
As ever care should be taken in interpreting the results, only sensible regular
|
||||
expressions (rather than pathological cases) are given, most are taken from the
|
||||
Boost regex examples, or from the <a href="http://www.regxlib.com/">Library of
|
||||
Regular Expressions</a>. In addition, some variation in the relative
|
||||
performance of these libraries can be expected on other machines - as memory
|
||||
access and processor caching effects can be quite large for most finite state
|
||||
machine algorithms.</P>
|
||||
<H3>Averages</H3>
|
||||
<P>The following are the average relative scores for all the tests: the perfect
|
||||
regular expression library would score 1, in practice anything less than 2
|
||||
is pretty good.</P>
|
||||
<P>%averages%</P>
|
||||
<h3>Comparison 1: Long Search</h3>
|
||||
<p>For each of the following regular expressions the time taken to find all
|
||||
occurrences of the expression within a long English language text was measured
|
||||
(<a href="http://www.gutenberg.org/files/3200/old/mtent12.zip">mtent12.txt</a>
|
||||
from <a href="http://promo.net/pg/">Project Gutenberg</a>, 19Mb). </p>
|
||||
<P>%long_twain_search%</P>
|
||||
<h3>Comparison 2: Medium Sized Search</h3>
|
||||
<p>For each of the following regular expressions the time taken to find all
|
||||
occurrences of the expression within a medium sized English language text was
|
||||
measured (the first 50K from mtent12.txt - up to the end of Chapter 1). </p>
|
||||
<P>%short_twain_search%</P>
|
||||
<H3>Comparison 3: C++ Code Search</H3>
|
||||
<P>For each of the following regular expressions the time taken to find all
|
||||
occurrences of the expression within the C++ source file <A href="../../../boost/crc.hpp">
|
||||
boost/crc.hpp</A> was measured. </P>
|
||||
<P>%code_search%</P>
|
||||
<H3>
|
||||
<H3>Comparison 4: HTML Document Search</H3>
|
||||
</H3>
|
||||
<P>For each of the following regular expressions the time taken to find all
|
||||
occurrences of the expression within the html file <A href="../../libraries.htm">libs/libraries.htm</A>
|
||||
was measured. </P>
|
||||
<P>%html_search%</P>
|
||||
<H3>Comparison 3: Simple Matches</H3>
|
||||
<p>
|
||||
For each of the following regular expressions the time taken to match against
|
||||
the text indicated was measured. </p>
|
||||
<P>%short_matches%</P>
|
||||
<hr>
|
||||
<p><i>© Copyright John Maddock 2003</i></p>
|
||||
<p><i>Use, modification and distribution are subject to the Boost Software License,
|
||||
Version 1.0. (See accompanying file <a href="../../../LICENSE_1_0.txt">LICENSE_1_0.txt</a>
|
||||
or copy at <a href="http://www.boost.org/LICENSE_1_0.txt">http://www.boost.org/LICENSE_1_0.txt</a>)</i></p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,280 +0,0 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 2002
|
||||
* John Maddock
|
||||
*
|
||||
* Use, modification and distribution are subject to the
|
||||
* Boost Software License, Version 1.0. (See accompanying file
|
||||
* LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
*
|
||||
*/
|
||||
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <iterator>
|
||||
#include <cassert>
|
||||
#include <boost/test/execution_monitor.hpp>
|
||||
#include "regex_comparison.hpp"
|
||||
|
||||
|
||||
void test_match(const std::string& re, const std::string& text, const std::string& description, bool icase)
|
||||
{
|
||||
double time;
|
||||
results r(re, description);
|
||||
|
||||
std::cout << "Testing: \"" << re << "\" against \"" << description << "\"" << std::endl;
|
||||
|
||||
#ifdef BOOST_HAS_GRETA
|
||||
if(time_greta == true)
|
||||
{
|
||||
time = g::time_match(re, text, icase);
|
||||
r.greta_time = time;
|
||||
std::cout << "\tGRETA regex: " << time << "s\n";
|
||||
}
|
||||
if(time_safe_greta == true)
|
||||
{
|
||||
time = gs::time_match(re, text, icase);
|
||||
r.safe_greta_time = time;
|
||||
std::cout << "\tSafe GRETA regex: " << time << "s\n";
|
||||
}
|
||||
#endif
|
||||
if(time_boost == true)
|
||||
{
|
||||
time = b::time_match(re, text, icase);
|
||||
r.boost_time = time;
|
||||
std::cout << "\tBoost regex: " << time << "s\n";
|
||||
}
|
||||
if(time_localised_boost == true)
|
||||
{
|
||||
time = bl::time_match(re, text, icase);
|
||||
r.localised_boost_time = time;
|
||||
std::cout << "\tBoost regex (C++ locale): " << time << "s\n";
|
||||
}
|
||||
#ifdef BOOST_HAS_POSIX
|
||||
if(time_posix == true)
|
||||
{
|
||||
time = posix::time_match(re, text, icase);
|
||||
r.posix_time = time;
|
||||
std::cout << "\tPOSIX regex: " << time << "s\n";
|
||||
}
|
||||
#endif
|
||||
#ifdef BOOST_HAS_PCRE
|
||||
if(time_pcre == true)
|
||||
{
|
||||
time = pcr::time_match(re, text, icase);
|
||||
r.pcre_time = time;
|
||||
std::cout << "\tPCRE regex: " << time << "s\n";
|
||||
}
|
||||
#endif
|
||||
#ifdef BOOST_HAS_XPRESSIVE
|
||||
if(time_xpressive == true)
|
||||
{
|
||||
time = dxpr::time_match(re, text, icase);
|
||||
r.xpressive_time = time;
|
||||
std::cout << "\txpressive regex: " << time << "s\n";
|
||||
}
|
||||
#endif
|
||||
#ifndef BOOST_NO_CXX11_HDR_REGEX
|
||||
if(time_std == true)
|
||||
{
|
||||
time = stdr::time_match(re, text, icase);
|
||||
r.std_time = time;
|
||||
std::cout << "\tstd::regex: " << time << "s\n";
|
||||
}
|
||||
#endif
|
||||
r.finalise();
|
||||
result_list.push_back(r);
|
||||
}
|
||||
|
||||
void test_find_all(const std::string& re, const std::string& text, const std::string& description, bool icase)
|
||||
{
|
||||
std::cout << "Testing: " << re << std::endl;
|
||||
|
||||
double time;
|
||||
results r(re, description);
|
||||
|
||||
#ifdef BOOST_HAS_GRETA
|
||||
if(time_greta == true)
|
||||
{
|
||||
time = g::time_find_all(re, text, icase);
|
||||
r.greta_time = time;
|
||||
std::cout << "\tGRETA regex: " << time << "s\n";
|
||||
}
|
||||
if(time_safe_greta == true)
|
||||
{
|
||||
time = gs::time_find_all(re, text, icase);
|
||||
r.safe_greta_time = time;
|
||||
std::cout << "\tSafe GRETA regex: " << time << "s\n";
|
||||
}
|
||||
#endif
|
||||
if(time_boost == true)
|
||||
{
|
||||
time = b::time_find_all(re, text, icase);
|
||||
r.boost_time = time;
|
||||
std::cout << "\tBoost regex: " << time << "s\n";
|
||||
}
|
||||
if(time_localised_boost == true)
|
||||
{
|
||||
time = bl::time_find_all(re, text, icase);
|
||||
r.localised_boost_time = time;
|
||||
std::cout << "\tBoost regex (C++ locale): " << time << "s\n";
|
||||
}
|
||||
#ifdef BOOST_HAS_POSIX
|
||||
if(time_posix == true)
|
||||
{
|
||||
time = posix::time_find_all(re, text, icase);
|
||||
r.posix_time = time;
|
||||
std::cout << "\tPOSIX regex: " << time << "s\n";
|
||||
}
|
||||
#endif
|
||||
#ifdef BOOST_HAS_PCRE
|
||||
if(time_pcre == true)
|
||||
{
|
||||
time = pcr::time_find_all(re, text, icase);
|
||||
r.pcre_time = time;
|
||||
std::cout << "\tPCRE regex: " << time << "s\n";
|
||||
}
|
||||
#endif
|
||||
#ifdef BOOST_HAS_XPRESSIVE
|
||||
if(time_xpressive == true)
|
||||
{
|
||||
time = dxpr::time_find_all(re, text, icase);
|
||||
r.xpressive_time = time;
|
||||
std::cout << "\txpressive regex: " << time << "s\n";
|
||||
}
|
||||
#endif
|
||||
#ifndef BOOST_NO_CXX11_HDR_REGEX
|
||||
if(time_std == true)
|
||||
{
|
||||
time = stdr::time_find_all(re, text, icase);
|
||||
r.std_time = time;
|
||||
std::cout << "\tstd::regex: " << time << "s\n";
|
||||
}
|
||||
#endif
|
||||
r.finalise();
|
||||
result_list.push_back(r);
|
||||
}
|
||||
|
||||
int cpp_main(int argc, char * argv[])
|
||||
{
|
||||
// start by processing the command line args:
|
||||
if(argc < 2)
|
||||
return show_usage();
|
||||
int result = 0;
|
||||
for(int c = 1; c < argc; ++c)
|
||||
{
|
||||
result += handle_argument(argv[c]);
|
||||
}
|
||||
if(result)
|
||||
return result;
|
||||
|
||||
if(test_matches)
|
||||
{
|
||||
// start with a simple test, this is basically a measure of the minimal overhead
|
||||
// involved in calling a regex matcher:
|
||||
test_match("abc", "abc");
|
||||
// these are from the regex docs:
|
||||
test_match("^([0-9]+)(\\-| |$)(.*)$", "100- this is a line of ftp response which contains a message string");
|
||||
test_match("([[:digit:]]{4}[- ]){3}[[:digit:]]{3,4}", "1234-5678-1234-456");
|
||||
// these are from http://www.regxlib.com/
|
||||
test_match("^([a-zA-Z0-9_\\-\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([a-zA-Z0-9\\-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$", "john@johnmaddock.co.uk");
|
||||
test_match("^([a-zA-Z0-9_\\-\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([a-zA-Z0-9\\-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$", "foo12@foo.edu");
|
||||
test_match("^([a-zA-Z0-9_\\-\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([a-zA-Z0-9\\-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$", "bob.smith@foo.tv");
|
||||
test_match("^[a-zA-Z]{1,2}[0-9][0-9A-Za-z]{0,1} {0,1}[0-9][A-Za-z]{2}$", "EH10 2QQ");
|
||||
test_match("^[a-zA-Z]{1,2}[0-9][0-9A-Za-z]{0,1} {0,1}[0-9][A-Za-z]{2}$", "G1 1AA");
|
||||
test_match("^[a-zA-Z]{1,2}[0-9][0-9A-Za-z]{0,1} {0,1}[0-9][A-Za-z]{2}$", "SW1 1ZZ");
|
||||
test_match("^[[:digit:]]{1,2}/[[:digit:]]{1,2}/[[:digit:]]{4}$", "4/1/2001");
|
||||
test_match("^[[:digit:]]{1,2}/[[:digit:]]{1,2}/[[:digit:]]{4}$", "12/12/2001");
|
||||
test_match("^[-+]?[[:digit:]]*\\.?[[:digit:]]*$", "123");
|
||||
test_match("^[-+]?[[:digit:]]*\\.?[[:digit:]]*$", "+3.14159");
|
||||
test_match("^[-+]?[[:digit:]]*\\.?[[:digit:]]*$", "-3.14159");
|
||||
}
|
||||
output_html_results(true, "%short_matches%");
|
||||
|
||||
std::string file_contents;
|
||||
|
||||
if(test_code)
|
||||
{
|
||||
load_file(file_contents, "../../../boost/crc.hpp");
|
||||
|
||||
const char* highlight_expression = // preprocessor directives: index 1
|
||||
"(^[ \t]*#(?:[^\\\\\\n]|\\\\[^\\n_[:punct:][:alnum:]]*[\\n[:punct:][:word:]])*)|"
|
||||
// comment: index 2
|
||||
"(//[^\\n]*|/\\*.*?\\*/)|"
|
||||
// literals: index 3
|
||||
"\\<([+-]?(?:(?:0x[[:xdigit:]]+)|(?:(?:[[:digit:]]*\\.)?[[:digit:]]+(?:[eE][+-]?[[:digit:]]+)?))u?(?:(?:int(?:8|16|32|64))|L)?)\\>|"
|
||||
// string literals: index 4
|
||||
"('(?:[^\\\\']|\\\\.)*'|\"(?:[^\\\\\"]|\\\\.)*\")|"
|
||||
// keywords: index 5
|
||||
"\\<(__asm|__cdecl|__declspec|__export|__far16|__fastcall|__fortran|__import"
|
||||
"|__pascal|__rtti|__stdcall|_asm|_cdecl|__except|_export|_far16|_fastcall"
|
||||
"|__finally|_fortran|_import|_pascal|_stdcall|__thread|__try|asm|auto|bool"
|
||||
"|break|case|catch|cdecl|char|class|const|const_cast|continue|default|delete"
|
||||
"|do|double|dynamic_cast|else|enum|explicit|extern|false|float|for|friend|goto"
|
||||
"|if|inline|int|long|mutable|namespace|new|operator|pascal|private|protected"
|
||||
"|public|register|reinterpret_cast|return|short|signed|sizeof|static|static_cast"
|
||||
"|struct|switch|template|this|throw|true|try|typedef|typeid|typename|union|unsigned"
|
||||
"|using|virtual|void|volatile|wchar_t|while)\\>"
|
||||
;
|
||||
|
||||
const char* class_expression = "^(template[[:space:]]*<[^;:{]+>[[:space:]]*)?"
|
||||
"(class|struct)[[:space:]]*(\\<\\w+\\>([ \t]*\\([^)]*\\))?"
|
||||
"[[:space:]]*)*(\\<\\w*\\>)[[:space:]]*(<[^;:{]+>[[:space:]]*)?"
|
||||
"(\\{|:[^;\\{()]*\\{)";
|
||||
|
||||
const char* include_expression = "^[ \t]*#[ \t]*include[ \t]+(\"[^\"]+\"|<[^>]+>)";
|
||||
const char* boost_include_expression = "^[ \t]*#[ \t]*include[ \t]+(\"boost/[^\"]+\"|<boost/[^>]+>)";
|
||||
|
||||
|
||||
test_find_all(class_expression, file_contents);
|
||||
test_find_all(highlight_expression, file_contents);
|
||||
test_find_all(include_expression, file_contents);
|
||||
test_find_all(boost_include_expression, file_contents);
|
||||
}
|
||||
output_html_results(false, "%code_search%");
|
||||
|
||||
if(test_html)
|
||||
{
|
||||
load_file(file_contents, "../../../libs/libraries.htm");
|
||||
test_find_all("beman|john|dave", file_contents, true);
|
||||
test_find_all("<p>.*?</p>", file_contents, true);
|
||||
test_find_all("<a[^>]+href=(\"[^\"]*\"|[^[:space:]]+)[^>]*>", file_contents, true);
|
||||
test_find_all("<h[12345678][^>]*>.*?</h[12345678]>", file_contents, true);
|
||||
test_find_all("<img[^>]+src=(\"[^\"]*\"|[^[:space:]]+)[^>]*>", file_contents, true);
|
||||
test_find_all("<font[^>]+face=(\"[^\"]*\"|[^[:space:]]+)[^>]*>.*?</font>", file_contents, true);
|
||||
}
|
||||
output_html_results(false, "%html_search%");
|
||||
|
||||
if(test_short_twain)
|
||||
{
|
||||
load_file(file_contents, "short_twain.txt");
|
||||
|
||||
test_find_all("Twain", file_contents);
|
||||
test_find_all("Huck[[:alpha:]]+", file_contents);
|
||||
test_find_all("[[:alpha:]]+ing", file_contents);
|
||||
test_find_all("^[^\n]*?Twain", file_contents);
|
||||
test_find_all("Tom|Sawyer|Huckleberry|Finn", file_contents);
|
||||
test_find_all("(Tom|Sawyer|Huckleberry|Finn).{0,30}river|river.{0,30}(Tom|Sawyer|Huckleberry|Finn)", file_contents);
|
||||
}
|
||||
output_html_results(false, "%short_twain_search%");
|
||||
|
||||
if(test_long_twain)
|
||||
{
|
||||
load_file(file_contents, "mtent13.txt");
|
||||
|
||||
test_find_all("Twain", file_contents);
|
||||
test_find_all("Huck[[:alpha:]]+", file_contents);
|
||||
test_find_all("[[:alpha:]]+ing", file_contents);
|
||||
test_find_all("^[^\n]*?Twain", file_contents);
|
||||
test_find_all("Tom|Sawyer|Huckleberry|Finn", file_contents);
|
||||
time_posix = false;
|
||||
test_find_all("(Tom|Sawyer|Huckleberry|Finn).{0,30}river|river.{0,30}(Tom|Sawyer|Huckleberry|Finn)", file_contents);
|
||||
time_posix = true;
|
||||
}
|
||||
output_html_results(false, "%long_twain_search%");
|
||||
|
||||
output_final_html();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,95 @@
|
||||
///////////////////////////////////////////////////////////////
|
||||
// Copyright 2015 John Maddock. Distributed under the Boost
|
||||
// Software License, Version 1.0. (See accompanying file
|
||||
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_
|
||||
//
|
||||
|
||||
#ifdef TEST_PCRE2
|
||||
|
||||
#define PCRE2_STATIC
|
||||
#define PCRE2_CODE_UNIT_WIDTH 8
|
||||
|
||||
#include "performance.hpp"
|
||||
#include <pcre2.h>
|
||||
#include <boost/version.hpp>
|
||||
#include <boost/lexical_cast.hpp>
|
||||
|
||||
struct pcre_regex : public abstract_regex
|
||||
{
|
||||
private:
|
||||
pcre2_code* pe;
|
||||
pcre2_match_data* pdata;
|
||||
public:
|
||||
pcre_regex()
|
||||
: pe(0)
|
||||
{
|
||||
pdata = pcre2_match_data_create(30, NULL);
|
||||
}
|
||||
~pcre_regex()
|
||||
{
|
||||
if(pe)
|
||||
pcre2_code_free(pe);
|
||||
pcre2_match_data_free(pdata);
|
||||
}
|
||||
virtual bool set_expression(const char* pat, bool isperl)
|
||||
{
|
||||
if(!isperl)
|
||||
return false;
|
||||
if(pe)
|
||||
pcre2_code_free(pe);
|
||||
int errorcode = 0;
|
||||
PCRE2_SIZE erroroffset;
|
||||
pe = pcre2_compile((PCRE2_SPTR)pat, std::strlen(pat), PCRE2_MULTILINE, &errorcode, &erroroffset, NULL);
|
||||
return pe ? true : false;
|
||||
}
|
||||
virtual bool match_test(const char* text);
|
||||
virtual unsigned find_all(const char* text);
|
||||
virtual std::string name();
|
||||
|
||||
struct initializer
|
||||
{
|
||||
initializer()
|
||||
{
|
||||
pcre_regex::register_instance(boost::shared_ptr<abstract_regex>(new pcre_regex));
|
||||
}
|
||||
void do_nothing()const {}
|
||||
};
|
||||
static const initializer init;
|
||||
};
|
||||
|
||||
const pcre_regex::initializer pcre_regex::init;
|
||||
|
||||
|
||||
bool pcre_regex::match_test(const char * text)
|
||||
{
|
||||
int r = pcre2_match(pe, (PCRE2_SPTR)text, std::strlen(text), 0, PCRE2_ANCHORED, pdata, NULL);
|
||||
return r >= 0;
|
||||
}
|
||||
|
||||
unsigned pcre_regex::find_all(const char * text)
|
||||
{
|
||||
unsigned count = 0;
|
||||
int flags = 0;
|
||||
const char* end = text + std::strlen(text);
|
||||
while(pcre2_match(pe, (PCRE2_SPTR)text, end - text, 0, flags, pdata, NULL) >= 0)
|
||||
{
|
||||
++count;
|
||||
PCRE2_SIZE* v = pcre2_get_ovector_pointer(pdata);
|
||||
text += v[1];
|
||||
if(v[0] == v[1])
|
||||
++text;
|
||||
if(*text)
|
||||
{
|
||||
flags = *(text - 1) == '\n' ? 0 : PCRE2_NOTBOL;
|
||||
}
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
std::string pcre_regex::name()
|
||||
{
|
||||
init.do_nothing();
|
||||
return std::string("PCRE-") + boost::lexical_cast<std::string>(PCRE2_MAJOR) + "." + boost::lexical_cast<std::string>(PCRE2_MINOR);
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,259 @@
|
||||
///////////////////////////////////////////////////////////////
|
||||
// Copyright 2015 John Maddock. Distributed under the Boost
|
||||
// Software License, Version 1.0. (See accompanying file
|
||||
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_
|
||||
//
|
||||
|
||||
#include "performance.hpp"
|
||||
#include <list>
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
#include <iomanip>
|
||||
#include <boost/chrono.hpp>
|
||||
#include <boost/detail/lightweight_main.hpp>
|
||||
#include <boost/regex.hpp>
|
||||
#include <boost/filesystem.hpp>
|
||||
|
||||
void load_file(std::string& text, const char* file)
|
||||
{
|
||||
std::deque<char> temp_copy;
|
||||
std::ifstream is(file);
|
||||
if(!is.good())
|
||||
{
|
||||
std::string msg("Unable to open file: \"");
|
||||
msg.append(file);
|
||||
msg.append("\"");
|
||||
throw std::runtime_error(msg);
|
||||
}
|
||||
is.seekg(0, std::ios_base::end);
|
||||
std::istream::pos_type pos = is.tellg();
|
||||
is.seekg(0, std::ios_base::beg);
|
||||
text.erase();
|
||||
text.reserve(pos);
|
||||
std::istreambuf_iterator<char> it(is);
|
||||
std::copy(it, std::istreambuf_iterator<char>(), std::back_inserter(text));
|
||||
}
|
||||
|
||||
|
||||
typedef std::list<boost::shared_ptr<abstract_regex> > list_type;
|
||||
|
||||
list_type& engines()
|
||||
{
|
||||
static list_type l;
|
||||
return l;
|
||||
}
|
||||
|
||||
void abstract_regex::register_instance(boost::shared_ptr<abstract_regex> item)
|
||||
{
|
||||
engines().push_back(item);
|
||||
}
|
||||
|
||||
template <class Clock>
|
||||
struct stopwatch
|
||||
{
|
||||
typedef typename Clock::duration duration;
|
||||
stopwatch()
|
||||
{
|
||||
m_start = Clock::now();
|
||||
}
|
||||
duration elapsed()
|
||||
{
|
||||
return Clock::now() - m_start;
|
||||
}
|
||||
void reset()
|
||||
{
|
||||
m_start = Clock::now();
|
||||
}
|
||||
|
||||
private:
|
||||
typename Clock::time_point m_start;
|
||||
};
|
||||
|
||||
unsigned sum = 0;
|
||||
unsigned last_value_returned = 0;
|
||||
|
||||
template <class Func>
|
||||
double exec_timed_test(Func f)
|
||||
{
|
||||
double t = 0;
|
||||
unsigned repeats = 1;
|
||||
do {
|
||||
stopwatch<boost::chrono::high_resolution_clock> w;
|
||||
|
||||
for(unsigned count = 0; count < repeats; ++count)
|
||||
{
|
||||
last_value_returned = f();
|
||||
sum += last_value_returned;
|
||||
}
|
||||
|
||||
t = boost::chrono::duration_cast<boost::chrono::duration<double>>(w.elapsed()).count();
|
||||
if(t < 0.5)
|
||||
repeats *= 2;
|
||||
} while(t < 0.5);
|
||||
return t / repeats;
|
||||
}
|
||||
|
||||
|
||||
std::string format_expression_as_quickbook(std::string s)
|
||||
{
|
||||
static const boost::regex e("[`/_*=$^@#&%\\\\]");
|
||||
static const boost::regex open_b("\\[");
|
||||
static const boost::regex close_b("\\]");
|
||||
s = regex_replace(s, e, "\\\\$0");
|
||||
s = regex_replace(s, open_b, "\\\\u005B");
|
||||
s = regex_replace(s, close_b, "\\\\u005D");
|
||||
if(s.size() > 200)
|
||||
{
|
||||
s.erase(200);
|
||||
s += " ...";
|
||||
}
|
||||
return "[^" + s + "]";
|
||||
}
|
||||
|
||||
void test_match(const char* expression, const char* text, bool isperl = false)
|
||||
{
|
||||
std::string table = "Testing simple " + (isperl ? std::string("Perl") : std::string("leftmost-longest")) + " matches (platform = " + platform_name() + ", compiler = " + compiler_name() + ")";
|
||||
std::string row = format_expression_as_quickbook(expression);
|
||||
row += "[br]";
|
||||
row += format_expression_as_quickbook(text);
|
||||
for(list_type::const_iterator i = engines().begin(); i != engines().end(); ++i)
|
||||
{
|
||||
std::string heading = (*i)->name();
|
||||
if((*i)->set_expression(expression, isperl))
|
||||
{
|
||||
double time = exec_timed_test([&]() { return (*i)->match_test(text) ? 1 : 0; });
|
||||
report_execution_time(time, table, row, heading);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void test_search(const char* expression, const char* text, bool isperl = false, const char* filename = 0)
|
||||
{
|
||||
std::string table = "Testing " + (isperl ? std::string("Perl") : std::string("leftmost-longest")) + " searches (platform = " + platform_name() + ", compiler = " + compiler_name() + ")";
|
||||
std::string row = format_expression_as_quickbook(expression);
|
||||
row += "[br]";
|
||||
if(filename)
|
||||
{
|
||||
row += "In file: ";
|
||||
row += filename;
|
||||
}
|
||||
else
|
||||
{
|
||||
row += format_expression_as_quickbook(text);
|
||||
}
|
||||
for(list_type::const_iterator i = engines().begin(); i != engines().end(); ++i)
|
||||
{
|
||||
std::string heading = (*i)->name();
|
||||
if((*i)->set_expression(expression, isperl))
|
||||
{
|
||||
double time = exec_timed_test([&]() { return (*i)->find_all(text); });
|
||||
report_execution_time(time, table, row, heading);
|
||||
std::cout << "Search with library: " << heading << " found " << last_value_returned << " occurances.\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int cpp_main(int argc, char* argv[])
|
||||
{
|
||||
boost::filesystem::path here(__FILE__);
|
||||
here = here.parent_path().parent_path().parent_path().parent_path();
|
||||
|
||||
boost::filesystem::path cpp_file = here / "boost";
|
||||
cpp_file /= "crc.hpp";
|
||||
|
||||
// start with a simple test, this is basically a measure of the minimal overhead
|
||||
// involved in calling a regex matcher:
|
||||
test_match("abc", "abc");
|
||||
// these are from the regex docs:
|
||||
test_match("^([0-9]+)(\\-| |$)(.*)$", "100- this is a line of ftp response which contains a message string");
|
||||
test_match("([[:digit:]]{4}[- ]){3}[[:digit:]]{3,4}", "1234-5678-1234-456");
|
||||
// these are from http://www.regxlib.com/
|
||||
test_match("^([a-zA-Z0-9_\\-\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([a-zA-Z0-9\\-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$", "john@johnmaddock.co.uk");
|
||||
test_match("^([a-zA-Z0-9_\\-\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([a-zA-Z0-9\\-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$", "foo12@foo.edu");
|
||||
test_match("^([a-zA-Z0-9_\\-\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([a-zA-Z0-9\\-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$", "bob.smith@foo.tv");
|
||||
test_match("^[a-zA-Z]{1,2}[0-9][0-9A-Za-z]{0,1} {0,1}[0-9][A-Za-z]{2}$", "EH10 2QQ");
|
||||
test_match("^[a-zA-Z]{1,2}[0-9][0-9A-Za-z]{0,1} {0,1}[0-9][A-Za-z]{2}$", "G1 1AA");
|
||||
test_match("^[a-zA-Z]{1,2}[0-9][0-9A-Za-z]{0,1} {0,1}[0-9][A-Za-z]{2}$", "SW1 1ZZ");
|
||||
test_match("^[[:digit:]]{1,2}/[[:digit:]]{1,2}/[[:digit:]]{4}$", "4/1/2001");
|
||||
test_match("^[[:digit:]]{1,2}/[[:digit:]]{1,2}/[[:digit:]]{4}$", "12/12/2001");
|
||||
test_match("^[-+]?[[:digit:]]*\\.?[[:digit:]]*$", "123");
|
||||
test_match("^[-+]?[[:digit:]]*\\.?[[:digit:]]*$", "+3.14159");
|
||||
test_match("^[-+]?[[:digit:]]*\\.?[[:digit:]]*$", "-3.14159");
|
||||
|
||||
// start with a simple test, this is basically a measure of the minimal overhead
|
||||
// involved in calling a regex matcher:
|
||||
test_match("abc", "abc", true);
|
||||
// these are from the regex docs:
|
||||
test_match("^([0-9]+)(\\-| |$)(.*)$", "100- this is a line of ftp response which contains a message string", true);
|
||||
test_match("([[:digit:]]{4}[- ]){3}[[:digit:]]{3,4}", "1234-5678-1234-456", true);
|
||||
// these are from http://www.regxlib.com/
|
||||
test_match("^([a-zA-Z0-9_\\-\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([a-zA-Z0-9\\-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$", "john@johnmaddock.co.uk", true);
|
||||
test_match("^([a-zA-Z0-9_\\-\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([a-zA-Z0-9\\-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$", "foo12@foo.edu", true);
|
||||
test_match("^([a-zA-Z0-9_\\-\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([a-zA-Z0-9\\-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$", "bob.smith@foo.tv", true);
|
||||
test_match("^[a-zA-Z]{1,2}[0-9][0-9A-Za-z]{0,1} {0,1}[0-9][A-Za-z]{2}$", "EH10 2QQ", true);
|
||||
test_match("^[a-zA-Z]{1,2}[0-9][0-9A-Za-z]{0,1} {0,1}[0-9][A-Za-z]{2}$", "G1 1AA", true);
|
||||
test_match("^[a-zA-Z]{1,2}[0-9][0-9A-Za-z]{0,1} {0,1}[0-9][A-Za-z]{2}$", "SW1 1ZZ", true);
|
||||
test_match("^[[:digit:]]{1,2}/[[:digit:]]{1,2}/[[:digit:]]{4}$", "4/1/2001", true);
|
||||
test_match("^[[:digit:]]{1,2}/[[:digit:]]{1,2}/[[:digit:]]{4}$", "12/12/2001", true);
|
||||
test_match("^[-+]?[[:digit:]]*\\.?[[:digit:]]*$", "123", true);
|
||||
test_match("^[-+]?[[:digit:]]*\\.?[[:digit:]]*$", "+3.14159", true);
|
||||
test_match("^[-+]?[[:digit:]]*\\.?[[:digit:]]*$", "-3.14159", true);
|
||||
|
||||
std::string file_contents;
|
||||
|
||||
const char* highlight_expression = // preprocessor directives: index 1
|
||||
"(^[ \\t]*#(?:(?>[^\\\\\\n]+)|\\\\(?>\\s*\\n|.))*)|";
|
||||
// comment: index 2
|
||||
"(//[^\\n]*|/\\*.*?\\*/)|"
|
||||
// literals: index 3
|
||||
"\\<([+-]?(?:(?:0x[[:xdigit:]]+)|(?:(?:[[:digit:]]*\\.)?[[:digit:]]+(?:[eE][+-]?[[:digit:]]+)?))u?(?:(?:int(?:8|16|32|64))|L)?)\\>|"
|
||||
// string literals: index 4
|
||||
"('(?:[^\\\\']|\\\\.)*'|\"(?:[^\\\\\"]|\\\\.)*\")|"
|
||||
// keywords: index 5
|
||||
"\\<(__asm|__cdecl|__declspec|__export|__far16|__fastcall|__fortran|__import"
|
||||
"|__pascal|__rtti|__stdcall|_asm|_cdecl|__except|_export|_far16|_fastcall"
|
||||
"|__finally|_fortran|_import|_pascal|_stdcall|__thread|__try|asm|auto|bool"
|
||||
"|break|case|catch|cdecl|char|class|const|const_cast|continue|default|delete"
|
||||
"|do|double|dynamic_cast|else|enum|explicit|extern|false|float|for|friend|goto"
|
||||
"|if|inline|int|long|mutable|namespace|new|operator|pascal|private|protected"
|
||||
"|public|register|reinterpret_cast|return|short|signed|sizeof|static|static_cast"
|
||||
"|struct|switch|template|this|throw|true|try|typedef|typeid|typename|union|unsigned"
|
||||
"|using|virtual|void|volatile|wchar_t|while)\\>"
|
||||
;
|
||||
const char* class_expression = "(template[[:space:]]*<[^;:{]+>[[:space:]]*)?"
|
||||
"(class|struct)[[:space:]]*(\\w+([ \t]*\\([^)]*\\))?"
|
||||
"[[:space:]]*)*(\\w*)[[:space:]]*(<[^;:{]+>[[:space:]]*)?"
|
||||
"(\\{|:[^;\\{()]*\\{)";
|
||||
const char* call_expression = "\\w+\\s*(\\([^()]++(?:(?1)[^()]++)*+[^)]*\\))";
|
||||
|
||||
const char* include_expression = "^[ \t]*#[ \t]*include[ \t]+(\"[^\"]+\"|<[^>]+>)";
|
||||
const char* boost_include_expression = "^[ \t]*#[ \t]*include[ \t]+(\"boost/[^\"]+\"|<boost/[^>]+>)";
|
||||
const char* brace_expression = "\\{[^{}]++((?0)[^{}]++)*+[^}]*+\\}";
|
||||
const char* function_with_body_expression = "(\\w+)\\s*(\\([^()]++(?:(?2)[^()]++)*+[^)]*\\))\\s*(\\{[^{}]++((?3)[^{}]++)*+[^}]*+\\})";
|
||||
|
||||
|
||||
load_file(file_contents, "../../../libs/libraries.htm");
|
||||
test_search("Beman|John|Dave", file_contents.c_str(), false, "../../../libs/libraries.htm");
|
||||
test_search("Beman|John|Dave", file_contents.c_str(), true, "../../../libs/libraries.htm");
|
||||
test_search("(?i)<p>.*?</p>", file_contents.c_str(), true, "../../../libs/libraries.htm");
|
||||
test_search("<a[^>]+href=(\"[^\"]*\"|[^[:space:]]+)[^>]*>", file_contents.c_str(), false, "../../../libs/libraries.htm");
|
||||
test_search("(?i)<a[^>]+href=(\"[^\"]*\"|[^[:space:]]+)[^>]*>", file_contents.c_str(), true, "../../../libs/libraries.htm");
|
||||
test_search("(?i)<h[12345678][^>]*>.*?</h[12345678]>", file_contents.c_str(), true, "../../../libs/libraries.htm");
|
||||
test_search("<img[^>]+src=(\"[^\"]*\"|[^[:space:]]+)[^>]*>", file_contents.c_str(), false, "../../../libs/libraries.htm");
|
||||
test_search("(?i)<img[^>]+src=(\"[^\"]*\"|[^[:space:]]+)[^>]*>", file_contents.c_str(), true, "../../../libs/libraries.htm");
|
||||
test_search("(?i)<font[^>]+face=(\"[^\"]*\"|[^[:space:]]+)[^>]*>.*?</font>", file_contents.c_str(), true, "../../../libs/libraries.htm");
|
||||
|
||||
|
||||
load_file(file_contents, "../../../boost/multiprecision/number.hpp");
|
||||
|
||||
test_search(function_with_body_expression, file_contents.c_str(), true, "boost/multiprecision/number.hpp");
|
||||
test_search(brace_expression, file_contents.c_str(), true, "boost/multiprecision/number.hpp");
|
||||
test_search(call_expression, file_contents.c_str(), true, "boost/multiprecision/number.hpp");
|
||||
test_search(highlight_expression, file_contents.c_str(), true, "boost/multiprecision/number.hpp");
|
||||
test_search(class_expression, file_contents.c_str(), true, "boost/multiprecision/number.hpp");
|
||||
test_search(include_expression, file_contents.c_str(), true, "boost/multiprecision/number.hpp");
|
||||
test_search(boost_include_expression, file_contents.c_str(), true, "boost/multiprecision/number.hpp");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
///////////////////////////////////////////////////////////////
|
||||
// Copyright 2015 John Maddock. Distributed under the Boost
|
||||
// Software License, Version 1.0. (See accompanying file
|
||||
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_
|
||||
//
|
||||
|
||||
#ifndef BOOST_REGEX_PERFRMANCE_HPP
|
||||
#define BOOST_REGEX_PERFRMANCE_HPP
|
||||
|
||||
#include <string>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
|
||||
struct abstract_regex
|
||||
{
|
||||
virtual bool set_expression(const char*, bool isperl) = 0;
|
||||
virtual bool match_test(const char* text) = 0;
|
||||
virtual unsigned find_all(const char* text) = 0;
|
||||
virtual std::string name() = 0;
|
||||
static void register_instance(boost::shared_ptr<abstract_regex> item);
|
||||
};
|
||||
|
||||
void report_execution_time(double t, std::string table, std::string row, std::string heading);
|
||||
std::string boost_name();
|
||||
std::string compiler_name();
|
||||
std::string platform_name();
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -0,0 +1,97 @@
|
||||
///////////////////////////////////////////////////////////////
|
||||
// Copyright 2015 John Maddock. Distributed under the Boost
|
||||
// Software License, Version 1.0. (See accompanying file
|
||||
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_
|
||||
//
|
||||
|
||||
#ifdef TEST_POSIX
|
||||
|
||||
#include "performance.hpp"
|
||||
#include <boost/lexical_cast.hpp>
|
||||
|
||||
#include <regex.h>
|
||||
|
||||
struct posix_regex : public abstract_regex
|
||||
{
|
||||
private:
|
||||
regex_t pe, pe2;
|
||||
bool init;
|
||||
public:
|
||||
posix_regex() : init(false) {}
|
||||
~posix_regex()
|
||||
{
|
||||
if(init)
|
||||
{
|
||||
regfree(&pe);
|
||||
regfree(&pe2);
|
||||
}
|
||||
}
|
||||
virtual bool set_expression(const char* pat, bool isperl)
|
||||
{
|
||||
if(isperl)
|
||||
return false;
|
||||
if(init)
|
||||
{
|
||||
regfree(&pe);
|
||||
regfree(&pe2);
|
||||
}
|
||||
else
|
||||
init = true;
|
||||
int r = regcomp(&pe, pat, REG_EXTENDED);
|
||||
std::string s(pat);
|
||||
if(s.size() && (s[0] != '^'))
|
||||
s.insert(0, 1, '^');
|
||||
if(s.size() && (*s.rbegin() != '$'))
|
||||
s.append("$");
|
||||
r |= regcomp(&pe2, s.c_str(), REG_EXTENDED);
|
||||
return r ? false : true;
|
||||
}
|
||||
virtual bool match_test(const char* text);
|
||||
virtual unsigned find_all(const char* text);
|
||||
virtual std::string name();
|
||||
|
||||
struct initializer
|
||||
{
|
||||
initializer()
|
||||
{
|
||||
posix_regex::register_instance(boost::shared_ptr<abstract_regex>(new posix_regex));
|
||||
}
|
||||
void do_nothing()const {}
|
||||
};
|
||||
static const initializer init2;
|
||||
};
|
||||
|
||||
const posix_regex::initializer posix_regex::init2;
|
||||
|
||||
|
||||
bool posix_regex::match_test(const char * text)
|
||||
{
|
||||
regmatch_t m[30];
|
||||
int r = regexec(&pe2, text, 30, m, 0);
|
||||
return r == 0;
|
||||
}
|
||||
|
||||
unsigned posix_regex::find_all(const char * text)
|
||||
{
|
||||
unsigned count = 0;
|
||||
regmatch_t m[30];
|
||||
int flags = 0;
|
||||
while(regexec(&pe, text, 30, m, flags) == 0)
|
||||
{
|
||||
++count;
|
||||
text += m[0].rm_eo;
|
||||
if(m[0].rm_eo - m[0].rm_so)
|
||||
flags = *(text - 1) == '\n' ? 0 : REG_NOTBOL;
|
||||
else
|
||||
flags = 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::string posix_regex::name()
|
||||
{
|
||||
init2.do_nothing();
|
||||
return "POSIX";
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,71 @@
|
||||
///////////////////////////////////////////////////////////////
|
||||
// Copyright 2015 John Maddock. Distributed under the Boost
|
||||
// Software License, Version 1.0. (See accompanying file
|
||||
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_
|
||||
//
|
||||
|
||||
#ifdef TEST_RE2
|
||||
|
||||
#include "performance.hpp"
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
#include <re2.h>
|
||||
|
||||
using namespace re2;
|
||||
|
||||
struct re2_regex : public abstract_regex
|
||||
{
|
||||
private:
|
||||
boost::scoped_ptr<RE2> pat;
|
||||
public:
|
||||
re2_regex() {}
|
||||
~re2_regex(){}
|
||||
virtual bool set_expression(const char* pp, bool isperl)
|
||||
{
|
||||
if(!isperl)
|
||||
return false;
|
||||
std::string s("(?m)");
|
||||
s += pp;
|
||||
pat.reset(new RE2(s));
|
||||
return pat->ok();
|
||||
}
|
||||
virtual bool match_test(const char* text);
|
||||
virtual unsigned find_all(const char* text);
|
||||
virtual std::string name();
|
||||
|
||||
struct initializer
|
||||
{
|
||||
initializer()
|
||||
{
|
||||
re2_regex::register_instance(boost::shared_ptr<abstract_regex>(new re2_regex));
|
||||
}
|
||||
void do_nothing()const {}
|
||||
};
|
||||
static const initializer init;
|
||||
};
|
||||
|
||||
const re2_regex::initializer re2_regex::init;
|
||||
|
||||
|
||||
bool re2_regex::match_test(const char * text)
|
||||
{
|
||||
return RE2::FullMatch(text, *pat);
|
||||
}
|
||||
|
||||
unsigned re2_regex::find_all(const char * text)
|
||||
{
|
||||
unsigned count = 0;
|
||||
StringPiece input(text);
|
||||
while(RE2::FindAndConsume(&input, *pat))
|
||||
{
|
||||
++count;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
std::string re2_regex::name()
|
||||
{
|
||||
init.do_nothing();
|
||||
return "RE2";
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,158 +0,0 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 2002
|
||||
* John Maddock
|
||||
*
|
||||
* Use, modification and distribution are subject to the
|
||||
* Boost Software License, Version 1.0. (See accompanying file
|
||||
* LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef REGEX_COMPARISON_HPP
|
||||
#define REGEX_COMPARISON_HPP
|
||||
|
||||
#include <string>
|
||||
#include <list>
|
||||
#include <boost/limits.hpp>
|
||||
|
||||
//
|
||||
// globals:
|
||||
//
|
||||
extern bool time_boost;
|
||||
extern bool time_localised_boost;
|
||||
extern bool time_greta;
|
||||
extern bool time_safe_greta;
|
||||
extern bool time_posix;
|
||||
extern bool time_pcre;
|
||||
extern bool time_xpressive;
|
||||
extern bool time_std;
|
||||
|
||||
extern bool test_matches;
|
||||
extern bool test_short_twain;
|
||||
extern bool test_long_twain;
|
||||
extern bool test_code;
|
||||
extern bool test_html;
|
||||
|
||||
extern std::string html_template_file;
|
||||
extern std::string html_out_file;
|
||||
extern std::string html_contents;
|
||||
|
||||
|
||||
int handle_argument(const std::string& what);
|
||||
int show_usage();
|
||||
void load_file(std::string& text, const char* file);
|
||||
void output_html_results(bool show_description, const std::string& tagname);
|
||||
void output_final_html();
|
||||
|
||||
|
||||
struct results
|
||||
{
|
||||
double boost_time;
|
||||
double localised_boost_time;
|
||||
double greta_time;
|
||||
double safe_greta_time;
|
||||
double posix_time;
|
||||
double pcre_time;
|
||||
double xpressive_time;
|
||||
double std_time;
|
||||
double factor;
|
||||
std::string expression;
|
||||
std::string description;
|
||||
results(const std::string& ex, const std::string& desc)
|
||||
: boost_time(-1),
|
||||
localised_boost_time(-1),
|
||||
greta_time(-1),
|
||||
safe_greta_time(-1),
|
||||
posix_time(-1),
|
||||
pcre_time(-1),
|
||||
xpressive_time(-1),
|
||||
std_time(-1),
|
||||
factor((std::numeric_limits<double>::max)()),
|
||||
expression(ex),
|
||||
description(desc)
|
||||
{}
|
||||
void finalise()
|
||||
{
|
||||
if((boost_time >= 0) && (boost_time < factor))
|
||||
factor = boost_time;
|
||||
if((localised_boost_time >= 0) && (localised_boost_time < factor))
|
||||
factor = localised_boost_time;
|
||||
if((greta_time >= 0) && (greta_time < factor))
|
||||
factor = greta_time;
|
||||
if((safe_greta_time >= 0) && (safe_greta_time < factor))
|
||||
factor = safe_greta_time;
|
||||
if((posix_time >= 0) && (posix_time < factor))
|
||||
factor = posix_time;
|
||||
if((pcre_time >= 0) && (pcre_time < factor))
|
||||
factor = pcre_time;
|
||||
if((xpressive_time >= 0) && (xpressive_time < factor))
|
||||
factor = xpressive_time;
|
||||
if((std_time >= 0) && (std_time < factor))
|
||||
factor = std_time;
|
||||
}
|
||||
};
|
||||
|
||||
extern std::list<results> result_list;
|
||||
|
||||
|
||||
namespace b {
|
||||
// boost tests:
|
||||
double time_match(const std::string& re, const std::string& text, bool icase);
|
||||
double time_find_all(const std::string& re, const std::string& text, bool icase);
|
||||
|
||||
}
|
||||
namespace bl {
|
||||
// localised boost tests:
|
||||
double time_match(const std::string& re, const std::string& text, bool icase);
|
||||
double time_find_all(const std::string& re, const std::string& text, bool icase);
|
||||
|
||||
}
|
||||
namespace pcr {
|
||||
// pcre tests:
|
||||
double time_match(const std::string& re, const std::string& text, bool icase);
|
||||
double time_find_all(const std::string& re, const std::string& text, bool icase);
|
||||
|
||||
}
|
||||
namespace g {
|
||||
// greta tests:
|
||||
double time_match(const std::string& re, const std::string& text, bool icase);
|
||||
double time_find_all(const std::string& re, const std::string& text, bool icase);
|
||||
|
||||
}
|
||||
namespace gs {
|
||||
// safe greta tests:
|
||||
double time_match(const std::string& re, const std::string& text, bool icase);
|
||||
double time_find_all(const std::string& re, const std::string& text, bool icase);
|
||||
|
||||
}
|
||||
namespace posix {
|
||||
// safe greta tests:
|
||||
double time_match(const std::string& re, const std::string& text, bool icase);
|
||||
double time_find_all(const std::string& re, const std::string& text, bool icase);
|
||||
|
||||
}
|
||||
namespace dxpr {
|
||||
// xpressive tests:
|
||||
double time_match(const std::string& re, const std::string& text, bool icase);
|
||||
double time_find_all(const std::string& re, const std::string& text, bool icase);
|
||||
}
|
||||
namespace stdr {
|
||||
// xpressive tests:
|
||||
double time_match(const std::string& re, const std::string& text, bool icase);
|
||||
double time_find_all(const std::string& re, const std::string& text, bool icase);
|
||||
}
|
||||
|
||||
void test_match(const std::string& re, const std::string& text, const std::string& description, bool icase = false);
|
||||
void test_find_all(const std::string& re, const std::string& text, const std::string& description, bool icase = false);
|
||||
inline void test_match(const std::string& re, const std::string& text, bool icase = false)
|
||||
{ test_match(re, text, text, icase); }
|
||||
inline void test_find_all(const std::string& re, const std::string& text, bool icase = false)
|
||||
{ test_find_all(re, text, "", icase); }
|
||||
|
||||
|
||||
#define REPEAT_COUNT 10
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
///////////////////////////////////////////////////////////////
|
||||
// Copyright 2015 John Maddock. Distributed under the Boost
|
||||
// Software License, Version 1.0. (See accompanying file
|
||||
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_
|
||||
//
|
||||
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#ifndef BOOST_NO_CXX11_HDR_REGEX
|
||||
|
||||
#include "performance.hpp"
|
||||
#include <regex>
|
||||
|
||||
struct std_regex : public abstract_regex
|
||||
{
|
||||
private:
|
||||
std::regex e;
|
||||
std::cmatch what;
|
||||
public:
|
||||
virtual bool set_expression(const char* pe, bool isperl)
|
||||
{
|
||||
try
|
||||
{
|
||||
e.assign(pe, isperl ? std::regex::ECMAScript : std::regex::extended);
|
||||
}
|
||||
catch(const std::exception&)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
virtual bool match_test(const char* text);
|
||||
virtual unsigned find_all(const char* text);
|
||||
virtual std::string name();
|
||||
|
||||
struct initializer
|
||||
{
|
||||
initializer()
|
||||
{
|
||||
std_regex::register_instance(boost::shared_ptr<abstract_regex>(new std_regex));
|
||||
}
|
||||
void do_nothing()const {}
|
||||
};
|
||||
static const initializer init;
|
||||
};
|
||||
|
||||
const std_regex::initializer std_regex::init;
|
||||
|
||||
|
||||
bool std_regex::match_test(const char * text)
|
||||
{
|
||||
return regex_match(text, what, e);
|
||||
}
|
||||
|
||||
unsigned std_regex::find_all(const char * text)
|
||||
{
|
||||
std::regex_iterator<const char*> i(text, text + std::strlen(text), e), j;
|
||||
unsigned count = 0;
|
||||
while(i != j)
|
||||
{
|
||||
++i;
|
||||
++count;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
std::string std_regex::name()
|
||||
{
|
||||
init.do_nothing();
|
||||
return "std::regex";
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,413 @@
|
||||
// Copyright John Maddock 2015.
|
||||
// Use, modification and distribution are subject to the
|
||||
// Boost Software License, Version 1.0. (See accompanying file
|
||||
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# pragma warning (disable : 4224)
|
||||
#endif
|
||||
|
||||
#include <boost/regex.hpp>
|
||||
#include <boost/lexical_cast.hpp>
|
||||
#include <boost/filesystem.hpp>
|
||||
#include <boost/filesystem/fstream.hpp>
|
||||
#include <vector>
|
||||
#include <set>
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
#include <iomanip>
|
||||
|
||||
std::vector<std::vector<double> > data;
|
||||
|
||||
inline std::string sanitize_string(const std::string& s)
|
||||
{
|
||||
static const boost::regex e("[^a-zA-Z0-9]+");
|
||||
std::string result = boost::regex_replace(s, e, "_");
|
||||
while(result[0] == '_')
|
||||
result.erase(0);
|
||||
return result;
|
||||
}
|
||||
|
||||
std::string format_precision(double val, int digits)
|
||||
{
|
||||
std::stringstream ss;
|
||||
ss << std::setprecision(digits);
|
||||
ss << std::fixed;
|
||||
ss << val;
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
static std::string content;
|
||||
boost::filesystem::path path_to_content;
|
||||
|
||||
struct content_loader
|
||||
{
|
||||
content_loader()
|
||||
{
|
||||
boost::filesystem::path p(__FILE__);
|
||||
p = p.parent_path();
|
||||
p /= "doc";
|
||||
p /= "performance_tables.qbk";
|
||||
path_to_content = p;
|
||||
if(boost::filesystem::exists(p))
|
||||
{
|
||||
boost::filesystem::ifstream is(p);
|
||||
if(is.good())
|
||||
{
|
||||
do
|
||||
{
|
||||
char c = static_cast<char>(is.get());
|
||||
if(c != EOF)
|
||||
content.append(1, c);
|
||||
} while(is.good());
|
||||
}
|
||||
}
|
||||
}
|
||||
~content_loader()
|
||||
{
|
||||
boost::filesystem::ofstream os(path_to_content);
|
||||
os << content;
|
||||
}
|
||||
void instantiate()const
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
static const content_loader loader;
|
||||
|
||||
void load_table(std::vector<std::vector<std::string> >& table, std::string::const_iterator begin, std::string::const_iterator end)
|
||||
{
|
||||
static const boost::regex item_e(
|
||||
"\\["
|
||||
"([^\\[\\]]*(?0)?)*"
|
||||
"\\]"
|
||||
);
|
||||
|
||||
boost::regex_token_iterator<std::string::const_iterator> i(begin, end, item_e), j;
|
||||
|
||||
while(i != j)
|
||||
{
|
||||
// Add a row:
|
||||
table.push_back(std::vector<std::string>());
|
||||
boost::regex_token_iterator<std::string::const_iterator> k(i->first + 1, i->second - 1, item_e);
|
||||
while(k != j)
|
||||
{
|
||||
// Add a cell:
|
||||
table.back().push_back(std::string(k->first + 1, k->second - 1));
|
||||
++k;
|
||||
}
|
||||
++i;
|
||||
}
|
||||
}
|
||||
|
||||
std::string save_table(std::vector<std::vector<std::string> >& table)
|
||||
{
|
||||
std::string result;
|
||||
|
||||
for(std::vector<std::vector<std::string> >::const_iterator i = table.begin(), j = table.end(); i != j; ++i)
|
||||
{
|
||||
result += "[";
|
||||
for(std::vector<std::string>::const_iterator k = i->begin(), l = i->end(); k != l; ++k)
|
||||
{
|
||||
result += "[";
|
||||
result += *k;
|
||||
result += "]";
|
||||
}
|
||||
result += "]\n";
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
void add_to_all_sections(const std::string& id, std::string list_name = "performance_all_sections")
|
||||
{
|
||||
std::string::size_type pos = content.find("[template " + list_name + "[]"), end_pos;
|
||||
if(pos == std::string::npos)
|
||||
{
|
||||
//
|
||||
// Just append to the end:
|
||||
//
|
||||
content.append("\n[template ").append(list_name).append("[]\n[").append(id).append("]\n]\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
//
|
||||
// Read in the all list of sections, add our new one (in alphabetical order),
|
||||
// and then rewrite the whole thing:
|
||||
//
|
||||
static const boost::regex item_e(
|
||||
"\\["
|
||||
"((?=[^\\]])[^\\[\\]]*+(?0)?+)*+"
|
||||
"\\]|\\]"
|
||||
);
|
||||
boost::regex_token_iterator<std::string::const_iterator> i(content.begin() + pos + 12 + list_name.size(), content.end(), item_e), j;
|
||||
std::set<std::string> sections;
|
||||
while(i != j)
|
||||
{
|
||||
if(i->length() == 1)
|
||||
{
|
||||
end_pos = i->first - content.begin();
|
||||
break;
|
||||
}
|
||||
sections.insert(std::string(i->first + 1, i->second - 1));
|
||||
++i;
|
||||
}
|
||||
sections.insert(id);
|
||||
std::string new_list = "\n";
|
||||
for(std::set<std::string>::const_iterator sec = sections.begin(); sec != sections.end(); ++sec)
|
||||
{
|
||||
new_list += "[" + *sec + "]\n";
|
||||
}
|
||||
content.replace(pos + 12 + list_name.size(), end_pos - pos - 12 - list_name.size(), new_list);
|
||||
}
|
||||
}
|
||||
|
||||
std::string get_colour(boost::uintmax_t val, boost::uintmax_t best)
|
||||
{
|
||||
if(val <= best * 1.2)
|
||||
return "green";
|
||||
if(val > best * 4)
|
||||
return "red";
|
||||
return "blue";
|
||||
}
|
||||
|
||||
boost::intmax_t get_value_from_cell(const std::string& cell)
|
||||
{
|
||||
static const boost::regex time_e("(\\d+)ns");
|
||||
boost::smatch what;
|
||||
if(regex_search(cell, what, time_e))
|
||||
{
|
||||
return boost::lexical_cast<boost::uintmax_t>(what.str(1));
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
void add_cell(boost::intmax_t val, const std::string& table_name, const std::string& row_name, const std::string& column_heading)
|
||||
{
|
||||
//
|
||||
// Load the table, add our data, and re-write:
|
||||
//
|
||||
std::string table_id = "table_" + sanitize_string(table_name);
|
||||
boost::regex table_e("\\[table:" + table_id
|
||||
+ "\\s(?:[^\\[]|\\\\.)++"
|
||||
"((\\["
|
||||
"((?:[^\\[\\]]|\\\\.)*+(?2)?+)*+"
|
||||
"\\]\\s*+)*+\\s*+)"
|
||||
"\\]"
|
||||
);
|
||||
|
||||
boost::smatch table_location;
|
||||
if(regex_search(content, table_location, table_e))
|
||||
{
|
||||
std::vector<std::vector<std::string> > table_data;
|
||||
load_table(table_data, table_location[1].first, table_location[1].second);
|
||||
//
|
||||
// Figure out which column we're on:
|
||||
//
|
||||
unsigned column_id = 1001u;
|
||||
for(unsigned i = 0; i < table_data[0].size(); ++i)
|
||||
{
|
||||
if(table_data[0][i] == column_heading)
|
||||
{
|
||||
column_id = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(column_id > 1000)
|
||||
{
|
||||
//
|
||||
// Need a new column, must be adding a new compiler to the table!
|
||||
//
|
||||
table_data[0].push_back(column_heading);
|
||||
for(unsigned i = 1; i < table_data.size(); ++i)
|
||||
table_data[i].push_back(std::string());
|
||||
column_id = table_data[0].size() - 1;
|
||||
}
|
||||
//
|
||||
// Figure out the row:
|
||||
//
|
||||
unsigned row_id = 1001;
|
||||
for(unsigned i = 1; i < table_data.size(); ++i)
|
||||
{
|
||||
if(table_data[i][0] == row_name)
|
||||
{
|
||||
row_id = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(row_id > 1000)
|
||||
{
|
||||
//
|
||||
// Need a new row, add it now:
|
||||
//
|
||||
table_data.push_back(std::vector<std::string>());
|
||||
table_data.back().push_back(row_name);
|
||||
for(unsigned i = 1; i < table_data[0].size(); ++i)
|
||||
table_data.back().push_back(std::string());
|
||||
row_id = table_data.size() - 1;
|
||||
}
|
||||
//
|
||||
// Find the best result in this row:
|
||||
//
|
||||
boost::uintmax_t best = (std::numeric_limits<boost::uintmax_t>::max)();
|
||||
std::vector<boost::intmax_t> values;
|
||||
for(unsigned i = 1; i < table_data[row_id].size(); ++i)
|
||||
{
|
||||
if(i == column_id)
|
||||
{
|
||||
if(val < best)
|
||||
best = val;
|
||||
values.push_back(val);
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout << "Existing cell value was " << table_data[row_id][i] << std::endl;
|
||||
boost::uintmax_t cell_val = get_value_from_cell(table_data[row_id][i]);
|
||||
std::cout << "Extracted value: " << cell_val << std::endl;
|
||||
if(cell_val < best)
|
||||
best = cell_val;
|
||||
values.push_back(cell_val);
|
||||
}
|
||||
}
|
||||
//
|
||||
// Update the row:
|
||||
//
|
||||
for(unsigned i = 1; i < table_data[row_id].size(); ++i)
|
||||
{
|
||||
std::string& s = table_data[row_id][i];
|
||||
s = "[role ";
|
||||
if(values[i - 1] < 0)
|
||||
{
|
||||
s += "grey -]";
|
||||
}
|
||||
else
|
||||
{
|
||||
s += get_colour(values[i - 1], best);
|
||||
s += " ";
|
||||
s += format_precision(static_cast<double>(values[i - 1]) / best, 2);
|
||||
s += "[br](";
|
||||
s += boost::lexical_cast<std::string>(values[i - 1]) + "ns)]";
|
||||
}
|
||||
}
|
||||
//
|
||||
// Convert back to a string and insert into content:
|
||||
std::sort(table_data.begin() + 1, table_data.end(), [](std::vector<std::string> const& a, std::vector<std::string> const& b) { return a[0] < b[0]; } );
|
||||
std::string c = save_table(table_data);
|
||||
content.replace(table_location.position(1), table_location.length(1), c);
|
||||
}
|
||||
else
|
||||
{
|
||||
//
|
||||
// Create a new table and try again:
|
||||
//
|
||||
std::string new_table = "\n[template " + table_id;
|
||||
new_table += "[]\n[table:" + table_id;
|
||||
new_table += " ";
|
||||
new_table += table_name;
|
||||
new_table += "\n[[Expression[br]Text][";
|
||||
new_table += column_heading;
|
||||
new_table += "]]\n";
|
||||
new_table += "[[";
|
||||
new_table += row_name;
|
||||
new_table += "][[role blue 1.00[br](";
|
||||
new_table += boost::lexical_cast<std::string>(val);
|
||||
new_table += "ns)]]]\n]\n]\n";
|
||||
|
||||
std::string::size_type pos = content.find("[/tables:]");
|
||||
if(pos != std::string::npos)
|
||||
content.insert(pos + 10, new_table);
|
||||
else
|
||||
content += "\n\n[/tables:]\n" + new_table;
|
||||
//
|
||||
// Add a section for this table as well:
|
||||
//
|
||||
std::string section_id = "section_" + sanitize_string(table_name);
|
||||
if(content.find(section_id + "[]") == std::string::npos)
|
||||
{
|
||||
std::string new_section = "\n[template " + section_id + "[]\n[section:" + section_id + " " + table_name + "]\n[" + table_id + "]\n[endsect]\n]\n";
|
||||
pos = content.find("[/sections:]");
|
||||
if(pos != std::string::npos)
|
||||
content.insert(pos + 12, new_section);
|
||||
else
|
||||
content += "\n\n[/sections:]\n" + new_section;
|
||||
add_to_all_sections(section_id);
|
||||
}
|
||||
//
|
||||
// Add to list of all tables (not in sections):
|
||||
//
|
||||
add_to_all_sections(table_id, "performance_all_tables");
|
||||
}
|
||||
}
|
||||
|
||||
void report_execution_time(double t, std::string table, std::string row, std::string heading)
|
||||
{
|
||||
try {
|
||||
add_cell(static_cast<boost::uintmax_t>(t / 1e-9), table, row, heading);
|
||||
}
|
||||
catch(const std::exception& e)
|
||||
{
|
||||
std::cout << "Error in adding cell: " << e.what() << std::endl;
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
std::string boost_name()
|
||||
{
|
||||
return "boost " + boost::lexical_cast<std::string>(BOOST_VERSION / 100000) + "." + boost::lexical_cast<std::string>((BOOST_VERSION / 100) % 1000);
|
||||
}
|
||||
|
||||
std::string compiler_name()
|
||||
{
|
||||
#ifdef COMPILER_NAME
|
||||
return COMPILER_NAME;
|
||||
#else
|
||||
return BOOST_COMPILER;
|
||||
#endif
|
||||
}
|
||||
|
||||
std::string platform_name()
|
||||
{
|
||||
#ifdef _WIN32
|
||||
return "Windows x64";
|
||||
#else
|
||||
return BOOST_PLATFORM;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
std::string get_compiler_options_name()
|
||||
{
|
||||
#if defined(BOOST_MSVC) || defined(__ICL)
|
||||
std::string result;
|
||||
#ifdef BOOST_MSVC
|
||||
result = "cl ";
|
||||
#else
|
||||
result = "icl ";
|
||||
#endif
|
||||
#ifdef _M_AMD64
|
||||
#ifdef __AVX__
|
||||
result += "/arch:AVX /Ox";
|
||||
#else
|
||||
result += "/Ox";
|
||||
#endif
|
||||
result += " (x64 build)";
|
||||
#else
|
||||
#ifdef _DEBUG
|
||||
result += "/Od";
|
||||
#elif defined(__AVX2__)
|
||||
result += "/arch:AVX2 /Ox";
|
||||
#elif defined(__AVX__)
|
||||
result += "/arch:AVX /Ox";
|
||||
#elif _M_IX86_FP == 2
|
||||
result += "/arch:sse2 /Ox";
|
||||
#else
|
||||
result += "/arch:ia32 /Ox";
|
||||
#endif
|
||||
result += " (x86 build)";
|
||||
#endif
|
||||
std::cout << "Compiler options are found as: " << result << std::endl;
|
||||
return result;
|
||||
#else
|
||||
return "Unknown";
|
||||
#endif
|
||||
}
|
||||
|
||||
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
Place third party headers and libraries in this directory to have them built as part of the performance test application.
|
||||
|
||||
Or install in your compiler's search paths if you prefer.
|
||||
@@ -1,119 +0,0 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 2002
|
||||
* John Maddock
|
||||
*
|
||||
* Use, modification and distribution are subject to the
|
||||
* Boost Software License, Version 1.0. (See accompanying file
|
||||
* LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
*
|
||||
*/
|
||||
|
||||
#include "regex_comparison.hpp"
|
||||
#include <iostream>
|
||||
#include <boost/timer.hpp>
|
||||
#include <boost/regex.hpp>
|
||||
|
||||
namespace b{
|
||||
|
||||
double time_match(const std::string& re, const std::string& text, bool icase)
|
||||
{
|
||||
try{
|
||||
boost::regex e(re, (icase ? boost::regex::perl | boost::regex::icase : boost::regex::perl));
|
||||
boost::smatch what;
|
||||
boost::timer tim;
|
||||
int iter = 1;
|
||||
int counter, repeats;
|
||||
double result = 0;
|
||||
double run;
|
||||
do
|
||||
{
|
||||
tim.restart();
|
||||
for(counter = 0; counter < iter; ++counter)
|
||||
{
|
||||
boost::regex_match(text, what, e);
|
||||
}
|
||||
result = tim.elapsed();
|
||||
iter *= 2;
|
||||
}while(result < 0.5);
|
||||
iter /= 2;
|
||||
|
||||
// repeat test and report least value for consistency:
|
||||
for(repeats = 0; repeats < REPEAT_COUNT; ++repeats)
|
||||
{
|
||||
tim.restart();
|
||||
for(counter = 0; counter < iter; ++counter)
|
||||
{
|
||||
boost::regex_match(text, what, e);
|
||||
}
|
||||
run = tim.elapsed();
|
||||
result = (std::min)(run, result);
|
||||
}
|
||||
return result / iter;
|
||||
}
|
||||
catch(const std::exception& e)
|
||||
{
|
||||
std::cout << "Exception: " << e.what() << std::endl;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
bool dummy_grep_proc(const boost::smatch&)
|
||||
{ return true; }
|
||||
|
||||
struct noop
|
||||
{
|
||||
void operator()( boost::smatch const & ) const
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
double time_find_all(const std::string& re, const std::string& text, bool icase)
|
||||
{
|
||||
try{
|
||||
boost::regex e(re, (icase ? boost::regex::perl | boost::regex::icase : boost::regex::perl));
|
||||
boost::smatch what;
|
||||
boost::timer tim;
|
||||
int iter = 1;
|
||||
int counter, repeats;
|
||||
double result = 0;
|
||||
double run;
|
||||
do
|
||||
{
|
||||
tim.restart();
|
||||
for(counter = 0; counter < iter; ++counter)
|
||||
{
|
||||
boost::sregex_iterator begin( text.begin(), text.end(), e ), end;
|
||||
std::for_each( begin, end, noop() );
|
||||
//boost::regex_grep(&dummy_grep_proc, text, e);
|
||||
}
|
||||
result = tim.elapsed();
|
||||
iter *= 2;
|
||||
}while(result < 0.5);
|
||||
iter /= 2;
|
||||
|
||||
if(result >10)
|
||||
return result / iter;
|
||||
|
||||
// repeat test and report least value for consistency:
|
||||
for(repeats = 0; repeats < REPEAT_COUNT; ++repeats)
|
||||
{
|
||||
tim.restart();
|
||||
for(counter = 0; counter < iter; ++counter)
|
||||
{
|
||||
boost::regex_grep(&dummy_grep_proc, text, e);
|
||||
}
|
||||
run = tim.elapsed();
|
||||
result = (std::min)(run, result);
|
||||
}
|
||||
return result / iter;
|
||||
}
|
||||
catch(const std::exception& e)
|
||||
{
|
||||
std::cout << "Exception: " << e.what() << std::endl;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,144 +0,0 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 2004
|
||||
* John Maddock
|
||||
*
|
||||
* Use, modification and distribution are subject to the
|
||||
* Boost Software License, Version 1.0. (See accompanying file
|
||||
* LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
*
|
||||
*/
|
||||
|
||||
#include "regex_comparison.hpp"
|
||||
|
||||
#ifdef BOOST_HAS_XPRESSIVE
|
||||
#include <cassert>
|
||||
#include <iostream>
|
||||
#include <boost/timer.hpp>
|
||||
#include <boost/xpressive/xpressive.hpp>
|
||||
|
||||
namespace dxpr
|
||||
{
|
||||
|
||||
double time_match(const std::string& re, const std::string& text, bool icase)
|
||||
{
|
||||
try{
|
||||
boost::xpressive::regex_constants::syntax_option_type flags = boost::xpressive::regex_constants::optimize;
|
||||
if(icase)
|
||||
flags = flags | boost::xpressive::regex_constants::icase;
|
||||
boost::xpressive::sregex e(boost::xpressive::sregex::compile(re, flags));
|
||||
boost::xpressive::smatch what;
|
||||
boost::timer tim;
|
||||
int iter = 1;
|
||||
int counter, repeats;
|
||||
double result = 0;
|
||||
double run;
|
||||
assert(boost::xpressive::regex_match( text, what, e ));
|
||||
do
|
||||
{
|
||||
tim.restart();
|
||||
for(counter = 0; counter < iter; ++counter)
|
||||
{
|
||||
boost::xpressive::regex_match( text, what, e );
|
||||
}
|
||||
result = tim.elapsed();
|
||||
iter *= 2;
|
||||
} while(result < 0.5);
|
||||
iter /= 2;
|
||||
|
||||
// repeat test and report least value for consistency:
|
||||
for(repeats = 0; repeats < REPEAT_COUNT; ++repeats)
|
||||
{
|
||||
tim.restart();
|
||||
for(counter = 0; counter < iter; ++counter)
|
||||
{
|
||||
boost::xpressive::regex_match( text, what, e );
|
||||
}
|
||||
run = tim.elapsed();
|
||||
result = (std::min)(run, result);
|
||||
}
|
||||
return result / iter;
|
||||
}
|
||||
catch(const std::exception& e)
|
||||
{
|
||||
std::cout << "Exception: " << e.what() << std::endl;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
struct noop
|
||||
{
|
||||
void operator()( boost::xpressive::smatch const & ) const
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
double time_find_all(const std::string& re, const std::string& text, bool icase)
|
||||
{
|
||||
try{
|
||||
boost::xpressive::regex_constants::syntax_option_type flags = boost::xpressive::regex_constants::optimize;
|
||||
if(icase)
|
||||
flags = flags | boost::xpressive::regex_constants::icase;
|
||||
boost::xpressive::sregex e(boost::xpressive::sregex::compile(re, flags));
|
||||
boost::xpressive::smatch what;
|
||||
boost::timer tim;
|
||||
int iter = 1;
|
||||
int counter, repeats;
|
||||
double result = 0;
|
||||
double run;
|
||||
do
|
||||
{
|
||||
tim.restart();
|
||||
for(counter = 0; counter < iter; ++counter)
|
||||
{
|
||||
boost::xpressive::sregex_iterator begin( text.begin(), text.end(), e ), end;
|
||||
std::for_each( begin, end, noop() );
|
||||
}
|
||||
result = tim.elapsed();
|
||||
iter *= 2;
|
||||
}while(result < 0.5);
|
||||
iter /= 2;
|
||||
|
||||
if(result >10)
|
||||
return result / iter;
|
||||
|
||||
// repeat test and report least value for consistency:
|
||||
for(repeats = 0; repeats < REPEAT_COUNT; ++repeats)
|
||||
{
|
||||
tim.restart();
|
||||
for(counter = 0; counter < iter; ++counter)
|
||||
{
|
||||
boost::xpressive::sregex_iterator begin( text.begin(), text.end(), e ), end;
|
||||
std::for_each( begin, end, noop() );
|
||||
}
|
||||
run = tim.elapsed();
|
||||
result = (std::min)(run, result);
|
||||
}
|
||||
return result / iter;
|
||||
}
|
||||
catch(const std::exception& e)
|
||||
{
|
||||
std::cout << "Exception: " << e.what() << std::endl;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
namespace dxpr{
|
||||
|
||||
double time_match(const std::string& re, const std::string& text, bool icase)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
double time_find_all(const std::string& re, const std::string& text, bool icase)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user