|
| 1 | +<html> |
| 2 | +<head> |
| 3 | +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> |
| 4 | +<title>Test and Example Programs</title> |
| 5 | +<link rel="stylesheet" href="../../../../../../doc/html/boostbook.css" type="text/css"> |
| 6 | +<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot_2006-12-17_0120"> |
| 7 | +<link rel="start" href="../../index.html" title="Boost.Regex"> |
| 8 | +<link rel="up" href="../background_information.html" title="Background Information"> |
| 9 | +<link rel="prev" href="thread_safety.html" title="Thread Safety"> |
| 10 | +<link rel="next" href="futher.html" title="References and Further Information"> |
| 11 | +</head> |
| 12 | +<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> |
| 13 | +<table cellpadding="2" width="100%"> |
| 14 | +<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td> |
| 15 | +<td align="center"><a href="../../../../../../index.htm">Home</a></td> |
| 16 | +<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td> |
| 17 | +<td align="center"><a href="../../../../../../people/people.htm">People</a></td> |
| 18 | +<td align="center"><a href="../../../../../../more/faq.htm">FAQ</a></td> |
| 19 | +<td align="center"><a href="../../../../../../more/index.htm">More</a></td> |
| 20 | +</table> |
| 21 | +<hr> |
| 22 | +<div class="spirit-nav"> |
| 23 | +<a accesskey="p" href="thread_safety.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../background_information.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="futher.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a> |
| 24 | +</div> |
| 25 | +<div class="section" lang="en"> |
| 26 | +<div class="titlepage"><div><div><h3 class="title"> |
| 27 | +<a name="boost_regex.background_information.examples"></a><a href="examples.html" title="Test and Example Programs"> Test and |
| 28 | + Example Programs</a></h3></div></div></div> |
| 29 | +<a name="boost_regex.background_information.examples.test_programs"></a><h5> |
| 30 | +<a name="id657467"></a> |
| 31 | + <a href="examples.html#boost_regex.background_information.examples.test_programs">Test |
| 32 | + Programs</a> |
| 33 | + </h5> |
| 34 | +<p> |
| 35 | + <span class="bold"><strong>regress:</strong></span> |
| 36 | + </p> |
| 37 | +<p> |
| 38 | + A regression test application that gives the matching/searching algorithms |
| 39 | + a full workout. The presence of this program is your guarantee that the library |
| 40 | + will behave as claimed - at least as far as those items tested are concerned |
| 41 | + - if anyone spots anything that isn't being tested I'd be glad to hear about |
| 42 | + it. |
| 43 | + </p> |
| 44 | +<p> |
| 45 | + Directory: <a href="../../../../test/regress" target="_top">libs/regex/test/regress</a>. |
| 46 | + </p> |
| 47 | +<p> |
| 48 | + Files: See directory. |
| 49 | + </p> |
| 50 | +<p> |
| 51 | + <span class="bold"><strong>bad_expression_test:</strong></span> |
| 52 | + </p> |
| 53 | +<p> |
| 54 | + Verifies that "bad" regular expressions don't cause the matcher |
| 55 | + to go into infinite loops, but to throw an exception instead. |
| 56 | + </p> |
| 57 | +<p> |
| 58 | + Directory: <a href="../../../../test/pathology" target="_top">libs/regex/test/pathology</a>. |
| 59 | + </p> |
| 60 | +<p> |
| 61 | + Files: <a href="../../../../test/pathology/bad_expression_test.cpp" target="_top">bad_expression_test.cpp</a>. |
| 62 | + </p> |
| 63 | +<p> |
| 64 | + <span class="bold"><strong>recursion_test:</strong></span> |
| 65 | + </p> |
| 66 | +<p> |
| 67 | + Verifies that the matcher can't overrun the stack (no matter what the expression). |
| 68 | + </p> |
| 69 | +<p> |
| 70 | + Directory: <a href="../../../../test/pathology" target="_top">libs/regex/test/pathology</a>. |
| 71 | + </p> |
| 72 | +<p> |
| 73 | + Files: <a href="../../../../test/pathology/recursion_test.cpp" target="_top">recursion_test.cpp</a>. |
| 74 | + </p> |
| 75 | +<p> |
| 76 | + <span class="bold"><strong>concepts:</strong></span> |
| 77 | + </p> |
| 78 | +<p> |
| 79 | + Verifies that the library meets all documented concepts (a compile only test). |
| 80 | + </p> |
| 81 | +<p> |
| 82 | + Directory: <a href="../../../../test/concepts" target="_top">libs/regex/test/concepts</a>. |
| 83 | + </p> |
| 84 | +<p> |
| 85 | + Files: <a href="../../../../test/concepts/concept_check.cpp" target="_top">concept_check.cpp</a>. |
| 86 | + </p> |
| 87 | +<p> |
| 88 | + <span class="bold"><strong>captures_test:</strong></span> |
| 89 | + </p> |
| 90 | +<p> |
| 91 | + Test code for captures. |
| 92 | + </p> |
| 93 | +<p> |
| 94 | + Directory: <a href="../../../../test/captures" target="_top">libs/test/captures</a>. |
| 95 | + </p> |
| 96 | +<p> |
| 97 | + Files: <a href="../../../../test/captures/captures_test.cpp" target="_top">captures_test.cpp</a>. |
| 98 | + </p> |
| 99 | +<a name="boost_regex.background_information.examples.example_programs"></a><h5> |
| 100 | +<a name="id657684"></a> |
| 101 | + <a href="examples.html#boost_regex.background_information.examples.example_programs">Example |
| 102 | + programs</a> |
| 103 | + </h5> |
| 104 | +<p> |
| 105 | + <span class="bold"><strong>grep</strong></span> |
| 106 | + </p> |
| 107 | +<p> |
| 108 | + A simple grep implementation, run with the -h command line option to find |
| 109 | + out its usage. |
| 110 | + </p> |
| 111 | +<p> |
| 112 | + Files: <a href="../../../../example/grep/grep.cpp" target="_top">grep.cpp</a> |
| 113 | + </p> |
| 114 | +<p> |
| 115 | + <span class="bold"><strong>timer.exe</strong></span> |
| 116 | + </p> |
| 117 | +<p> |
| 118 | + A simple interactive expression matching application, the results of all |
| 119 | + matches are timed, allowing the programmer to optimize their regular expressions |
| 120 | + where performance is critical. |
| 121 | + </p> |
| 122 | +<p> |
| 123 | + Files: <a href="../../../../example/timer/regex_timer.cpp" target="_top">regex_timer.cpp</a>. |
| 124 | + </p> |
| 125 | +<a name="boost_regex.background_information.examples.code_snippets"></a><h5> |
| 126 | +<a name="id657767"></a> |
| 127 | + <a href="examples.html#boost_regex.background_information.examples.code_snippets">Code |
| 128 | + snippets</a> |
| 129 | + </h5> |
| 130 | +<p> |
| 131 | + The snippets examples contain the code examples used in the documentation: |
| 132 | + </p> |
| 133 | +<p> |
| 134 | + <a href="../../../../example/snippets/captures_example.cpp" target="_top">captures_example.cpp</a>: |
| 135 | + Demonstrates the use of captures. |
| 136 | + </p> |
| 137 | +<p> |
| 138 | + <a href="../../../../example/snippets/credit_card_example.cpp" target="_top">credit_card_example.cpp</a>: |
| 139 | + Credit card number formatting code. |
| 140 | + </p> |
| 141 | +<p> |
| 142 | + <a href="../../../../example/snippets/partial_regex_grep.cpp" target="_top">partial_regex_grep.cpp</a>: |
| 143 | + Search example using partial matches. |
| 144 | + </p> |
| 145 | +<p> |
| 146 | + <a href="../../../../example/snippets/partial_regex_match.cpp" target="_top">partial_regex_match.cpp</a>: |
| 147 | + regex_match example using partial matches. |
| 148 | + </p> |
| 149 | +<p> |
| 150 | + <a href="../../../../example/snippets/regex_iterator_example.cpp" target="_top">regex_iterator_example.cpp</a>: |
| 151 | + Iterating through a series of matches. |
| 152 | + </p> |
| 153 | +<p> |
| 154 | + <a href="../../../../example/snippets/regex_match_example.cpp" target="_top">regex_match_example.cpp</a>: |
| 155 | + ftp based regex_match example. |
| 156 | + </p> |
| 157 | +<p> |
| 158 | + <a href="../../../../example/snippets/regex_merge_example.cpp" target="_top">regex_merge_example.cpp</a>: |
| 159 | + regex_merge example: converts a C++ file to syntax highlighted HTML. |
| 160 | + </p> |
| 161 | +<p> |
| 162 | + <a href="../../../../example/snippets/regex_replace_example.cpp" target="_top">regex_replace_example.cpp</a>: |
| 163 | + regex_replace example: converts a C++ file to syntax highlighted HTML |
| 164 | + </p> |
| 165 | +<p> |
| 166 | + <a href="../../../../example/snippets/regex_search_example.cpp" target="_top">regex_search_example.cpp</a>: |
| 167 | + regex_search example: searches a cpp file for class definitions. |
| 168 | + </p> |
| 169 | +<p> |
| 170 | + <a href="../../../../example/snippets/regex_token_iterator_eg_1.cpp" target="_top">regex_token_iterator_eg_1.cpp</a>: |
| 171 | + split a string into a series of tokens. |
| 172 | + </p> |
| 173 | +<p> |
| 174 | + <a href="../../../../example/snippets/regex_token_iterator_eg_2.cpp" target="_top">regex_token_iterator_eg_2.cpp</a>: |
| 175 | + enumerate the linked URL's in a HTML file. |
| 176 | + </p> |
| 177 | +<p> |
| 178 | + The following are deprecated: |
| 179 | + </p> |
| 180 | +<p> |
| 181 | + <a href="../../../../example/snippets/regex_grep_example_1.cpp" target="_top">regex_grep_example_1.cpp</a>: |
| 182 | + regex_grep example 1: searches a cpp file for class definitions. |
| 183 | + </p> |
| 184 | +<p> |
| 185 | + <a href="../../../../example/snippets/regex_grep_example_2.cpp" target="_top">regex_grep_example_2.cpp</a>: |
| 186 | + regex_grep example 2: searches a cpp file for class definitions, using a |
| 187 | + global callback function. |
| 188 | + </p> |
| 189 | +<p> |
| 190 | + <a href="../../../../example/snippets/regex_grep_example_3.cpp" target="_top">regex_grep_example_3.cpp</a>: |
| 191 | + regex_grep example 2: searches a cpp file for class definitions, using a |
| 192 | + bound member function callback. |
| 193 | + </p> |
| 194 | +<p> |
| 195 | + <a href="../../../../example/snippets/regex_grep_example_4.cpp" target="_top">regex_grep_example_4.cpp</a>: |
| 196 | + regex_grep example 2: searches a cpp file for class definitions, using a |
| 197 | + C++ Builder closure as a callback. |
| 198 | + </p> |
| 199 | +<p> |
| 200 | + <a href="../../../../example/snippets/regex_split_example_1.cpp" target="_top">regex_split_example_1.cpp</a>: |
| 201 | + regex_split example: split a string into tokens. |
| 202 | + </p> |
| 203 | +<p> |
| 204 | + <a href="../../../../example/snippets/regex_split_example_2.cpp" target="_top">regex_split_example_2.cpp</a> |
| 205 | + : regex_split example: spit out linked URL's. |
| 206 | + </p> |
| 207 | +</div> |
| 208 | +<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> |
| 209 | +<td align="left"></td> |
| 210 | +<td align="right"><small>Copyright © 2007 John Maddock</small></td> |
| 211 | +</tr></table> |
| 212 | +<hr> |
| 213 | +<div class="spirit-nav"> |
| 214 | +<a accesskey="p" href="thread_safety.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../background_information.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="futher.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a> |
| 215 | +</div> |
| 216 | +</body> |
| 217 | +</html> |
0 commit comments