mirror of
https://github.com/boostorg/regex.git
synced 2025-07-31 21:14:36 +02:00
Merge branch 'develop'
This commit is contained in:
@@ -60,9 +60,9 @@ if ! $(disable-icu)
|
|||||||
|
|
||||||
lib icuin : : <name>icui18n <link>shared <runtime-link>shared <conditional>@path_options ;
|
lib icuin : : <name>icui18n <link>shared <runtime-link>shared <conditional>@path_options ;
|
||||||
lib icuin : : <toolset>msvc <variant>debug <name>icuind <link>shared <runtime-link>shared <conditional>@path_options ;
|
lib icuin : : <toolset>msvc <variant>debug <name>icuind <link>shared <runtime-link>shared <conditional>@path_options ;
|
||||||
lib icuin : : <toolset>msvc <variant>release <name>icuin <link>shared <runtime-link>shared <conditional>@path_options ;
|
lib icuin : : <toolset>msvc <name>icuin <link>shared <runtime-link>shared <conditional>@path_options ;
|
||||||
lib icuin : : <toolset>intel <target-os>windows <variant>debug <name>icuind <link>shared <runtime-link>shared <conditional>@path_options ;
|
lib icuin : : <toolset>intel <target-os>windows <variant>debug <name>icuind <link>shared <runtime-link>shared <conditional>@path_options ;
|
||||||
lib icuin : : <toolset>intel <target-os>windows <variant>release <name>icuin <link>shared <runtime-link>shared <conditional>@path_options ;
|
lib icuin : : <toolset>intel <target-os>windows <name>icuin <link>shared <runtime-link>shared <conditional>@path_options ;
|
||||||
lib icuin : : <name>this_is_an_invalid_library_name ;
|
lib icuin : : <name>this_is_an_invalid_library_name ;
|
||||||
|
|
||||||
if $(ICU_PATH)
|
if $(ICU_PATH)
|
||||||
@@ -103,12 +103,13 @@ if ! $(disable-icu)
|
|||||||
<library>icuin/<link>shared/<runtime-link>shared
|
<library>icuin/<link>shared/<runtime-link>shared
|
||||||
<define>BOOST_HAS_ICU=1
|
<define>BOOST_HAS_ICU=1
|
||||||
<runtime-link>shared
|
<runtime-link>shared
|
||||||
<toolset>msvc:<linkflags>/delayload:$(icuucd_name:B).dll
|
# As of ICU-54 this does not work anymore (release mode):
|
||||||
<toolset>msvc:<linkflags>/delayload:$(icuuc_name:B).dll
|
#<toolset>msvc:<linkflags>/delayload:$(icuucd_name:B).dll
|
||||||
<toolset>msvc:<linkflags>/delayload:$(icudt_name:B).dll
|
#<toolset>msvc:<linkflags>/delayload:$(icuuc_name:B).dll
|
||||||
<toolset>msvc:<linkflags>/delayload:$(icuin_name:B).dll
|
#<toolset>msvc:<linkflags>/delayload:$(icudt_name:B).dll
|
||||||
<toolset>msvc:<linkflags>/delayload:$(icuind_name:B).dll
|
#<toolset>msvc:<linkflags>/delayload:$(icuin_name:B).dll
|
||||||
<toolset>msvc:<linkflags>delayimp.lib
|
#<toolset>msvc:<linkflags>/delayload:$(icuind_name:B).dll
|
||||||
|
#<toolset>msvc:<linkflags>delayimp.lib
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -25,7 +25,7 @@ this gets bumped up from v4 to v5.
|
|||||||
* Fixed documentation typos from [@https://svn.boost.org/trac/boost/ticket/9283 #9283].
|
* Fixed documentation typos from [@https://svn.boost.org/trac/boost/ticket/9283 #9283].
|
||||||
* Fixed bug in collation code that failed if the locale generated collation strings with embedded nul's,
|
* Fixed bug in collation code that failed if the locale generated collation strings with embedded nul's,
|
||||||
see [@https://svn.boost.org/trac/boost/ticket/9451 #9451].
|
see [@https://svn.boost.org/trac/boost/ticket/9451 #9451].
|
||||||
* Apply patch for unusual thread usage (no statically initiallized mutexes), see [@https://svn.boost.org/trac/boost/ticket/9461 #9461].
|
* Apply patch for unusual thread usage (no statically initialized mutexes), see [@https://svn.boost.org/trac/boost/ticket/9461 #9461].
|
||||||
* Added better checks for invalid UTF-8 sequences, see [@https://svn.boost.org/trac/boost/ticket/9473 #9473].
|
* Added better checks for invalid UTF-8 sequences, see [@https://svn.boost.org/trac/boost/ticket/9473 #9473].
|
||||||
|
|
||||||
[h4 Boost-1.54]
|
[h4 Boost-1.54]
|
||||||
@@ -153,7 +153,7 @@ and
|
|||||||
* Breaking Change: POSIX-extended and POSIX-basic regular expressions now enforce the letter of the POSIX standard much more closely than before.
|
* Breaking Change: POSIX-extended and POSIX-basic regular expressions now enforce the letter of the POSIX standard much more closely than before.
|
||||||
* Added support for (?imsx-imsx) constructs.
|
* Added support for (?imsx-imsx) constructs.
|
||||||
* Added support for lookbehind expressions (?<=positive-lookbehind) and (?<!negative-lookbehind).
|
* Added support for lookbehind expressions (?<=positive-lookbehind) and (?<!negative-lookbehind).
|
||||||
* Added support for conditional expressions (?(assertion)true-expresion|false-expression).
|
* Added support for conditional expressions (?(assertion)true-expression|false-expression).
|
||||||
* Added MFC/ATL string wrappers.
|
* Added MFC/ATL string wrappers.
|
||||||
* Added Unicode support; based on ICU.
|
* Added Unicode support; based on ICU.
|
||||||
* Changed newline support to recognise \\f as a line separator (all character types), and \\x85 as a line separator for wide characters / Unicode only.
|
* Changed newline support to recognise \\f as a line separator (all character types), and \\x85 as a line separator for wide characters / Unicode only.
|
||||||
|
@@ -43,7 +43,7 @@ this:
|
|||||||
|
|
||||||
- has_icu builds : yes
|
- has_icu builds : yes
|
||||||
|
|
||||||
Whick means that ICU has been found, and support for it will be enabled
|
Which means that ICU has been found, and support for it will be enabled
|
||||||
in the library build.
|
in the library build.
|
||||||
|
|
||||||
[tip If you don't want the regex library to use ICU then build with the
|
[tip If you don't want the regex library to use ICU then build with the
|
||||||
|
@@ -69,7 +69,7 @@ Note how we had to add some extra escapes to the expression: remember that
|
|||||||
the escape is seen once by the C++ compiler, before it gets to be seen by
|
the escape is seen once by the C++ compiler, before it gets to be seen by
|
||||||
the regular expression engine, consequently escapes in regular expressions
|
the regular expression engine, consequently escapes in regular expressions
|
||||||
have to be doubled up when embedding them in C/C++ code. Also note that
|
have to be doubled up when embedding them in C/C++ code. Also note that
|
||||||
all the examples assume that your compiler supports argument-dependent-lookup
|
all the examples assume that your compiler supports argument-dependent
|
||||||
lookup, if yours doesn't (for example VC6), then you will have to add some
|
lookup, if yours doesn't (for example VC6), then you will have to add some
|
||||||
`boost::` prefixes to some of the function calls in the examples.
|
`boost::` prefixes to some of the function calls in the examples.
|
||||||
|
|
||||||
|
@@ -165,7 +165,7 @@ catalogue. The messages and their id's are as follows:
|
|||||||
[[150][The character which when preceded by an escape character represents any single character.]["C" ]]
|
[[150][The character which when preceded by an escape character represents any single character.]["C" ]]
|
||||||
[[151][The character which when preceded by an escape character represents end of buffer operator.]["Z" ]]
|
[[151][The character which when preceded by an escape character represents end of buffer operator.]["Z" ]]
|
||||||
[[152][The character which when preceded by an escape character represents the continuation assertion.]["G" ]]
|
[[152][The character which when preceded by an escape character represents the continuation assertion.]["G" ]]
|
||||||
[[153][The character which when preceeded by (? indicates a zero width negated forward lookahead assert.][! ]]
|
[[153][The character which when preceded by (? indicates a zero width negated forward lookahead assert.][! ]]
|
||||||
]
|
]
|
||||||
|
|
||||||
Custom error messages are loaded as follows:
|
Custom error messages are loaded as follows:
|
||||||
|
@@ -17,7 +17,7 @@ Certainly any string type that provides access to it's internal buffer, along
|
|||||||
with it's length, can be converted into a pair of pointers (which can be
|
with it's length, can be converted into a pair of pointers (which can be
|
||||||
used as iterators).
|
used as iterators).
|
||||||
|
|
||||||
Some non-standard string types are sufficiently common that wappers have been
|
Some non-standard string types are sufficiently common that wrappers have been
|
||||||
provided for them already: currently this includes the ICU and MFC string class
|
provided for them already: currently this includes the ICU and MFC string class
|
||||||
types.
|
types.
|
||||||
|
|
||||||
|
@@ -109,7 +109,7 @@ Member functions for class RegEx are defined as follows:
|
|||||||
`SetExpression(p, false)`. Throws [bad_expression] on failure. ]]
|
`SetExpression(p, false)`. Throws [bad_expression] on failure. ]]
|
||||||
[[`RegEx& operator=(const std::string& s);`][Assignment operator, equivalent to
|
[[`RegEx& operator=(const std::string& s);`][Assignment operator, equivalent to
|
||||||
calling `SetExpression(s, false)`. Throws [bad_expression] on failure. ]]
|
calling `SetExpression(s, false)`. Throws [bad_expression] on failure. ]]
|
||||||
[[`unsigned int SetExpression(constchar* p, bool icase = false);`][Sets the
|
[[`unsigned int SetExpression(const char* p, bool icase = false);`][Sets the
|
||||||
current expression to /p/, if /icase/ is true then matching is
|
current expression to /p/, if /icase/ is true then matching is
|
||||||
insensitive to case, otherwise it is sensitive to case.
|
insensitive to case, otherwise it is sensitive to case.
|
||||||
Throws [bad_expression] on failure. ]]
|
Throws [bad_expression] on failure. ]]
|
||||||
@@ -165,7 +165,7 @@ Member functions for class RegEx are defined as follows:
|
|||||||
[match_flag_type] /flags/. For each match pushes the starting index of what
|
[match_flag_type] /flags/. For each match pushes the starting index of what
|
||||||
matched onto /v/. Returns the number of matches found. ]]
|
matched onto /v/. Returns the number of matches found. ]]
|
||||||
[[`unsigned int GrepFiles(GrepFileCallback cb, const char* files, bool recurse = false, boost::match_flag_type flags = match_default);`]
|
[[`unsigned int GrepFiles(GrepFileCallback cb, const char* files, bool recurse = false, boost::match_flag_type flags = match_default);`]
|
||||||
[Finds all matches of the current expression in the files files using
|
[Finds all matches of the current expression in the files /files/ using
|
||||||
the [match_flag_type] /flags/. For each match calls the call-back function cb.
|
the [match_flag_type] /flags/. For each match calls the call-back function cb.
|
||||||
If the call-back returns false then the algorithm returns without
|
If the call-back returns false then the algorithm returns without
|
||||||
considering further matches in the current file, or any further files.
|
considering further matches in the current file, or any further files.
|
||||||
@@ -178,7 +178,7 @@ Member functions for class RegEx are defined as follows:
|
|||||||
|
|
||||||
May throw an exception derived from `std::runtime_error` if file io fails.]]
|
May throw an exception derived from `std::runtime_error` if file io fails.]]
|
||||||
[[`unsigned int GrepFiles(GrepFileCallback cb, const std::string& files, bool recurse = false, boost::match_flag_type flags = match_default);`]
|
[[`unsigned int GrepFiles(GrepFileCallback cb, const std::string& files, bool recurse = false, boost::match_flag_type flags = match_default);`]
|
||||||
[Finds all matches of the current expression in the files files using the
|
[Finds all matches of the current expression in the files /files/ using the
|
||||||
[match_flag_type] /flags/. For each match calls the call-back function cb.
|
[match_flag_type] /flags/. For each match calls the call-back function cb.
|
||||||
|
|
||||||
If the call-back returns false then the algorithm returns without
|
If the call-back returns false then the algorithm returns without
|
||||||
@@ -229,7 +229,7 @@ Member functions for class RegEx are defined as follows:
|
|||||||
to determine what gets matched, and how the format string should be
|
to determine what gets matched, and how the format string should be
|
||||||
treated. If /copy/ is true then all unmatched sections of input are
|
treated. If /copy/ is true then all unmatched sections of input are
|
||||||
copied unchanged to output, if the flag /format_first_only/ is set then
|
copied unchanged to output, if the flag /format_first_only/ is set then
|
||||||
only the first occurance of the pattern found is replaced.
|
only the first occurrence of the pattern found is replaced.
|
||||||
Returns the new string. See also
|
Returns the new string. See also
|
||||||
[link boost_regex.format format string syntax], and [match_flag_type].]]
|
[link boost_regex.format format string syntax], and [match_flag_type].]]
|
||||||
[[`std::string Merge(const char* in, const char* fmt, bool copy = true, boost::match_flag_type flags = match_default);`]
|
[[`std::string Merge(const char* in, const char* fmt, bool copy = true, boost::match_flag_type flags = match_default);`]
|
||||||
@@ -239,7 +239,7 @@ Member functions for class RegEx are defined as follows:
|
|||||||
what gets matched, and how the format string should be treated.
|
what gets matched, and how the format string should be treated.
|
||||||
If /copy/ is true then all unmatched sections of input are copied
|
If /copy/ is true then all unmatched sections of input are copied
|
||||||
unchanged to output, if the flag /format_first_only/ is set then only
|
unchanged to output, if the flag /format_first_only/ is set then only
|
||||||
the first occurance of the pattern found is replaced. Returns
|
the first occurrence of the pattern found is replaced. Returns
|
||||||
the new string. See also [link boost_regex.format format string syntax], and [match_flag_type].]]
|
the new string. See also [link boost_regex.format format string syntax], and [match_flag_type].]]
|
||||||
[[`unsigned Split(std::vector<std::string>& v, std::string& s, boost::match_flag_type flags = match_default, unsigned max_count = ~0);`]
|
[[`unsigned Split(std::vector<std::string>& v, std::string& s, boost::match_flag_type flags = match_default, unsigned max_count = ~0);`]
|
||||||
[Splits the input string and pushes each one onto the vector.
|
[Splits the input string and pushes each one onto the vector.
|
||||||
|
@@ -87,7 +87,7 @@ from a html file, and print them out to cout:
|
|||||||
char c;
|
char c;
|
||||||
while(is.get(c))
|
while(is.get(c))
|
||||||
{
|
{
|
||||||
// use logarithmic growth stategy, in case
|
// use logarithmic growth strategy, in case
|
||||||
// in_avail (above) returned zero:
|
// in_avail (above) returned zero:
|
||||||
if(s.capacity() == s.size())
|
if(s.capacity() == s.size())
|
||||||
s.reserve(s.capacity() * 3);
|
s.reserve(s.capacity() * 3);
|
||||||
|
@@ -156,7 +156,7 @@ An expression of the form `[[.col.]` matches the collating element /col/.
|
|||||||
A collating element is any single character, or any sequence of
|
A collating element is any single character, or any sequence of
|
||||||
characters that collates as a single unit. Collating elements may also
|
characters that collates as a single unit. Collating elements may also
|
||||||
be used as the end point of a range, for example: `[[.ae.]-c]` matches
|
be used as the end point of a range, for example: `[[.ae.]-c]` matches
|
||||||
the character sequence "ae", plus any single character in the rangle "ae"-c,
|
the character sequence "ae", plus any single character in the range "ae"-c,
|
||||||
assuming that "ae" is treated as a single collating element in the current locale.
|
assuming that "ae" is treated as a single collating element in the current locale.
|
||||||
|
|
||||||
Collating elements may be used in place of escapes (which are not
|
Collating elements may be used in place of escapes (which are not
|
||||||
|
@@ -397,10 +397,10 @@ void copy_results(MR1& out, MR2 const& in)
|
|||||||
out.set_base(in.base().base());
|
out.set_base(in.base().base());
|
||||||
for(int i = 0; i < (int)in.size(); ++i)
|
for(int i = 0; i < (int)in.size(); ++i)
|
||||||
{
|
{
|
||||||
if(in[i].matched)
|
if(in[i].matched || !i)
|
||||||
{
|
{
|
||||||
out.set_first(in[i].first.base(), i);
|
out.set_first(in[i].first.base(), i);
|
||||||
out.set_second(in[i].second.base(), i);
|
out.set_second(in[i].second.base(), i, in[i].matched);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1220,7 +1220,7 @@ bool basic_regex_parser<charT, traits>::parse_alt()
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
fail(regex_constants::error_empty, this->m_position - this->m_base, "A regular expression can start with the alternation operator |.");
|
fail(regex_constants::error_empty, this->m_position - this->m_base, "A regular expression cannot start with the alternation operator |.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
|
@@ -76,10 +76,15 @@ public:
|
|||||||
// construct/copy/destroy:
|
// construct/copy/destroy:
|
||||||
explicit match_results(const Allocator& a = Allocator())
|
explicit match_results(const Allocator& a = Allocator())
|
||||||
#ifndef BOOST_NO_STD_ALLOCATOR
|
#ifndef BOOST_NO_STD_ALLOCATOR
|
||||||
: m_subs(a), m_base(), m_last_closed_paren(0), m_is_singular(true) {}
|
: m_subs(a), m_base(), m_null(), m_last_closed_paren(0), m_is_singular(true) {}
|
||||||
#else
|
#else
|
||||||
: m_subs(), m_base(), m_last_closed_paren(0), m_is_singular(true) { (void)a; }
|
: m_subs(), m_base(), m_null(), m_last_closed_paren(0), m_is_singular(true) { (void)a; }
|
||||||
#endif
|
#endif
|
||||||
|
//
|
||||||
|
// IMPORTANT: in the code below, the crazy looking checks around m_is_singular are
|
||||||
|
// all required because it is illegal to copy a singular iterator.
|
||||||
|
// See https://svn.boost.org/trac/boost/ticket/3632.
|
||||||
|
//
|
||||||
match_results(const match_results& m)
|
match_results(const match_results& m)
|
||||||
: m_subs(m.m_subs), m_named_subs(m.m_named_subs), m_last_closed_paren(m.m_last_closed_paren), m_is_singular(m.m_is_singular)
|
: m_subs(m.m_subs), m_named_subs(m.m_named_subs), m_last_closed_paren(m.m_last_closed_paren), m_is_singular(m.m_is_singular)
|
||||||
{
|
{
|
||||||
|
@@ -254,13 +254,8 @@ class repeater_count
|
|||||||
std::size_t count; // the number of iterations so far
|
std::size_t count; // the number of iterations so far
|
||||||
BidiIterator start_pos; // where the last repeat started
|
BidiIterator start_pos; // where the last repeat started
|
||||||
public:
|
public:
|
||||||
repeater_count(repeater_count** s)
|
repeater_count(repeater_count** s) : stack(s), next(0), state_id(-1), count(0), start_pos() {}
|
||||||
{
|
|
||||||
stack = s;
|
|
||||||
next = 0;
|
|
||||||
state_id = -1;
|
|
||||||
count = 0;
|
|
||||||
}
|
|
||||||
repeater_count(int i, repeater_count** s, BidiIterator start)
|
repeater_count(int i, repeater_count** s, BidiIterator start)
|
||||||
: start_pos(start)
|
: start_pos(start)
|
||||||
{
|
{
|
||||||
|
@@ -96,7 +96,7 @@ class basic_regex_formatter
|
|||||||
public:
|
public:
|
||||||
typedef typename traits::char_type char_type;
|
typedef typename traits::char_type char_type;
|
||||||
basic_regex_formatter(OutputIterator o, const Results& r, const traits& t)
|
basic_regex_formatter(OutputIterator o, const Results& r, const traits& t)
|
||||||
: m_traits(t), m_results(r), m_out(o), m_state(output_copy), m_restore_state(output_copy), m_have_conditional(false) {}
|
: m_traits(t), m_results(r), m_out(o), m_position(), m_end(), m_flags(), m_state(output_copy), m_restore_state(output_copy), m_have_conditional(false) {}
|
||||||
OutputIterator format(ForwardIter p1, ForwardIter p2, match_flag_type f);
|
OutputIterator format(ForwardIter p1, ForwardIter p2, match_flag_type f);
|
||||||
OutputIterator format(ForwardIter p1, match_flag_type f)
|
OutputIterator format(ForwardIter p1, match_flag_type f)
|
||||||
{
|
{
|
||||||
|
@@ -71,7 +71,7 @@ using std::distance;
|
|||||||
|
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
*
|
*
|
||||||
* Fix broken broken namespace support:
|
* Fix broken namespace support:
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
@@ -267,15 +267,16 @@ void mapfile::lock(pointer* node)const
|
|||||||
read_size = std::fread(*node + sizeof(int), _size % buf_size, 1, hfile);
|
read_size = std::fread(*node + sizeof(int), _size % buf_size, 1, hfile);
|
||||||
else
|
else
|
||||||
read_size = std::fread(*node + sizeof(int), buf_size, 1, hfile);
|
read_size = std::fread(*node + sizeof(int), buf_size, 1, hfile);
|
||||||
#ifndef BOOST_NO_EXCEPTIONS
|
|
||||||
if((read_size == 0) || (std::ferror(hfile)))
|
if((read_size == 0) || (std::ferror(hfile)))
|
||||||
{
|
{
|
||||||
|
#ifndef BOOST_NO_EXCEPTIONS
|
||||||
|
unlock(node);
|
||||||
throw std::runtime_error("Unable to read file.");
|
throw std::runtime_error("Unable to read file.");
|
||||||
}
|
|
||||||
#else
|
#else
|
||||||
BOOST_REGEX_NOEH_ASSERT((0 == std::ferror(hfile)) && (read_size != 0));
|
BOOST_REGEX_NOEH_ASSERT((0 == std::ferror(hfile)) && (read_size != 0));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(*reinterpret_cast<int*>(*node) == 0)
|
if(*reinterpret_cast<int*>(*node) == 0)
|
||||||
|
Reference in New Issue
Block a user