mirror of
https://github.com/boostorg/regex.git
synced 2025-07-15 21:32:18 +02:00
Merged typo fixes from trunk.
[SVN r42026]
This commit is contained in:
@ -1,14 +1,13 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
<title> FAQ</title>
|
||||
<title>FAQ</title>
|
||||
<link rel="stylesheet" href="../../../../../../doc/html/boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.66.1">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot_2006-12-17_0120">
|
||||
<link rel="start" href="../../index.html" title="Boost.Regex">
|
||||
<link rel="up" href="../background_information.html" title="Background Information">
|
||||
<link rel="prev" href="futher.html" title=" References
|
||||
and Further Information">
|
||||
<link rel="next" href="performance.html" title=" Performance">
|
||||
<link rel="prev" href="futher.html" title="References and Further Information">
|
||||
<link rel="next" href="performance.html" title="Performance">
|
||||
</head>
|
||||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
||||
<table cellpadding="2" width="100%"><tr>
|
||||
@ -25,13 +24,14 @@
|
||||
</div>
|
||||
<div class="section" lang="en">
|
||||
<div class="titlepage"><div><div><h3 class="title">
|
||||
<a name="boost_regex.background_information.faq"></a><a href="faq.html" title=" FAQ"> FAQ</a></h3></div></div></div>
|
||||
<a name="boost_regex.background_information.faq"></a><a href="faq.html" title="FAQ"> FAQ</a>
|
||||
</h3></div></div></div>
|
||||
<p>
|
||||
<span class="bold"><b>Q.</b></span> I can't get regex++ to work with escape
|
||||
<span class="bold"><strong>Q.</strong></span> I can't get regex++ to work with escape
|
||||
characters, what's going on?
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><b>A.</b></span> If you embed regular expressions in C++
|
||||
<span class="bold"><strong>A.</strong></span> If you embed regular expressions in C++
|
||||
code, then remember that escape characters are processed twice: once by the
|
||||
C++ compiler, and once by the Boost.Regex expression compiler, so to pass
|
||||
the regular expression \d+ to Boost.Regex, you need to embed "\d+"
|
||||
@ -39,21 +39,21 @@
|
||||
"\\" in your code.
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><b>Q.</b></span> No matter what I do regex_match always
|
||||
<span class="bold"><strong>Q.</strong></span> No matter what I do regex_match always
|
||||
returns false, what's going on?
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><b>A.</b></span> The algorithm regex_match only succeeds
|
||||
if the expression matches <span class="bold"><b>all</b></span> of the text,
|
||||
if you want to <span class="bold"><b>find</b></span> a sub-string within
|
||||
<span class="bold"><strong>A.</strong></span> The algorithm regex_match only succeeds
|
||||
if the expression matches <span class="bold"><strong>all</strong></span> of the text,
|
||||
if you want to <span class="bold"><strong>find</strong></span> a sub-string within
|
||||
the text that matches the expression then use regex_search instead.
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><b>Q.</b></span> Why does using parenthesis in a POSIX
|
||||
<span class="bold"><strong>Q.</strong></span> Why does using parenthesis in a POSIX
|
||||
regular expression change the result of a match?
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><b>A.</b></span> For POSIX (extended and basic) regular
|
||||
<span class="bold"><strong>A.</strong></span> For POSIX (extended and basic) regular
|
||||
expressions, but not for perl regexes, parentheses don't only mark; they
|
||||
determine what the best match is as well. When the expression is compiled
|
||||
as a POSIX basic or extended regex then Boost.Regex follows the POSIX standard
|
||||
@ -85,11 +85,11 @@
|
||||
as the expression.
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><b>Q.</b></span> Why don't character ranges work properly
|
||||
<span class="bold"><strong>Q.</strong></span> Why don't character ranges work properly
|
||||
(POSIX mode only)?
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><b>A.</b></span> The POSIX standard specifies that character
|
||||
<span class="bold"><strong>A.</strong></span> The POSIX standard specifies that character
|
||||
range expressions are locale sensitive - so for example the expression [A-Z]
|
||||
will match any collating element that collates between 'A' and 'Z'. That
|
||||
means that for most locales other than "C" or "POSIX",
|
||||
@ -97,39 +97,39 @@
|
||||
most people expect - or at least not what most people have come to expect
|
||||
from regular expression engines. For this reason, the default behaviour of
|
||||
Boost.Regex (perl mode) is to turn locale sensitive collation off by not
|
||||
setting the <tt class="computeroutput"><span class="identifier">regex_constants</span><span class="special">::</span><span class="identifier">collate</span></tt>
|
||||
setting the <code class="computeroutput"><span class="identifier">regex_constants</span><span class="special">::</span><span class="identifier">collate</span></code>
|
||||
compile time flag. However if you set a non-default compile time flag - for
|
||||
example <tt class="computeroutput"><span class="identifier">regex_constants</span><span class="special">::</span><span class="identifier">extended</span></tt> or <tt class="computeroutput"><span class="identifier">regex_constants</span><span class="special">::</span><span class="identifier">basic</span></tt>,
|
||||
example <code class="computeroutput"><span class="identifier">regex_constants</span><span class="special">::</span><span class="identifier">extended</span></code> or <code class="computeroutput"><span class="identifier">regex_constants</span><span class="special">::</span><span class="identifier">basic</span></code>,
|
||||
then locale dependent collation will be enabled, this also applies to the
|
||||
POSIX API functions which use either <tt class="computeroutput"><span class="identifier">regex_constants</span><span class="special">::</span><span class="identifier">extended</span></tt>
|
||||
or <tt class="computeroutput"><span class="identifier">regex_constants</span><span class="special">::</span><span class="identifier">basic</span></tt> internally. [Note - when <tt class="computeroutput"><span class="identifier">regex_constants</span><span class="special">::</span><span class="identifier">nocollate</span></tt> in effect, the library behaves
|
||||
POSIX API functions which use either <code class="computeroutput"><span class="identifier">regex_constants</span><span class="special">::</span><span class="identifier">extended</span></code>
|
||||
or <code class="computeroutput"><span class="identifier">regex_constants</span><span class="special">::</span><span class="identifier">basic</span></code> internally. [Note - when <code class="computeroutput"><span class="identifier">regex_constants</span><span class="special">::</span><span class="identifier">nocollate</span></code> in effect, the library behaves
|
||||
"as if" the LC_COLLATE locale category were always "C",
|
||||
regardless of what its actually set to - end note].
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><b>Q.</b></span> Why are there no throw specifications
|
||||
<span class="bold"><strong>Q.</strong></span> Why are there no throw specifications
|
||||
on any of the functions? What exceptions can the library throw?
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><b>A.</b></span> Not all compilers support (or honor)
|
||||
<span class="bold"><strong>A.</strong></span> Not all compilers support (or honor)
|
||||
throw specifications, others support them but with reduced efficiency. Throw
|
||||
specifications may be added at a later date as compilers begin to handle
|
||||
this better. The library should throw only three types of exception: [boost::regex_error]
|
||||
can be thrown by <a href="../ref/basic_regex.html" title=" basic_regex"><tt class="computeroutput"><span class="identifier">basic_regex</span></tt></a> when compiling a regular
|
||||
expression, <tt class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">runtime_error</span></tt> can be thrown when a call
|
||||
to <tt class="computeroutput"><span class="identifier">basic_regex</span><span class="special">::</span><span class="identifier">imbue</span></tt> tries to open a message catalogue
|
||||
that doesn't exist, or when a call to <a href="../ref/regex_search.html" title=" regex_search"><tt class="computeroutput"><span class="identifier">regex_search</span></tt></a> or <a href="../ref/regex_match.html" title=" regex_match"><tt class="computeroutput"><span class="identifier">regex_match</span></tt></a> results in an "everlasting"
|
||||
search, or when a call to <tt class="computeroutput"><span class="identifier">RegEx</span><span class="special">::</span><span class="identifier">GrepFiles</span></tt>
|
||||
or <tt class="computeroutput"><span class="identifier">RegEx</span><span class="special">::</span><span class="identifier">FindFiles</span></tt> tries to open a file that cannot
|
||||
be opened, finally <tt class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">bad_alloc</span></tt> can be thrown by just about any
|
||||
can be thrown by <a href="../ref/basic_regex.html" title="basic_regex"><code class="computeroutput"><span class="identifier">basic_regex</span></code></a> when compiling a regular
|
||||
expression, <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">runtime_error</span></code> can be thrown when a call
|
||||
to <code class="computeroutput"><span class="identifier">basic_regex</span><span class="special">::</span><span class="identifier">imbue</span></code> tries to open a message catalogue
|
||||
that doesn't exist, or when a call to <a href="../ref/regex_search.html" title="regex_search"><code class="computeroutput"><span class="identifier">regex_search</span></code></a> or <a href="../ref/regex_match.html" title="regex_match"><code class="computeroutput"><span class="identifier">regex_match</span></code></a> results in an "everlasting"
|
||||
search, or when a call to <code class="computeroutput"><span class="identifier">RegEx</span><span class="special">::</span><span class="identifier">GrepFiles</span></code>
|
||||
or <code class="computeroutput"><span class="identifier">RegEx</span><span class="special">::</span><span class="identifier">FindFiles</span></code> tries to open a file that cannot
|
||||
be opened, finally <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">bad_alloc</span></code> can be thrown by just about any
|
||||
of the functions in this library.
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><b>Q.</b></span> Why can't I use the "convenience"
|
||||
<span class="bold"><strong>Q.</strong></span> Why can't I use the "convenience"
|
||||
versions of regex_match / regex_search / regex_grep / regex_format / regex_merge?
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><b>A.</b></span> These versions may or may not be available
|
||||
<span class="bold"><strong>A.</strong></span> These versions may or may not be available
|
||||
depending upon the capabilities of your compiler, the rules determining the
|
||||
format of these functions are quite complex - and only the versions visible
|
||||
to a standard compliant compiler are given in the help. To find out what
|
||||
@ -141,10 +141,11 @@
|
||||
</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"><small>Copyright <20> 2007 John Maddock<p>
|
||||
<td align="right"><div class="copyright-footer">Copyright <20> 1998 -2007 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></small></div></td>
|
||||
</p>
|
||||
</div></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
|
Reference in New Issue
Block a user