diff --git a/doc/Attic/bad_expression.html b/doc/Attic/bad_expression.html index cf840f34..8dd0c0b7 100644 --- a/doc/Attic/bad_expression.html +++ b/doc/Attic/bad_expression.html @@ -2,76 +2,80 @@
-
- |
-
- Boost.Regex-class bad_expression- |
-
- |
-
#include <boost/pat_except.hpp> -
-The class bad_expression
defines the type of objects thrown as
+
+ |
+
+ Boost.Regex+class bad_expression+ |
+
+ |
+
#include <boost/pattern_except.hpp>
+The class bad_expression
defines the type of objects thrown as
exceptions to report errors during the conversion from a string representing a
- regular expression to a finite state machine.
namespace boost{ + regular expression to a finite state machine. +++namespace boost{ -class bad_pattern : public std::runtime_error +class bad_pattern : public std::runtime_error { -public: - explicit bad_pattern(const std::string& s) : std::runtime_error(s){}; +public: + explicit bad_pattern(const std::string& s) : std::runtime_error(s){}; }; -class bad_expression : public bad_pattern +class bad_expression : public bad_pattern { -public: - bad_expression(const std::string& s) : bad_pattern(s) {} +public: + bad_expression(const std::string& s) : bad_pattern(s) {} }; -} // namespace boost-Description
-bad_expression(const string& what_arg);-Effects: Constructs an object of class
- -bad_expression
.- Postcondition:
strcmp(what(), what_arg.c_str()) == 0
. -Footnotes: the class bad_pattern forms the base class for all - pattern-matching exceptions, of which bad_expression is one. The choice - of std::runtime_error as the base class for bad_pattern - is moot, depending upon how the library is used exceptions may be either logic - errors (programmer supplied expressions) or run time errors (user supplied - expressions). -
-
- +} // namespace boost +
+bad_expression(const string& what_arg); ++
Effects: Constructs an object of class bad_expression
.
Postcondition: strcmp(what(), what_arg.c_str()) == 0
.
Footnotes: the class bad_pattern forms the base class for all + pattern-matching exceptions, of which bad_expression is one. The choice + of std::runtime_error as the base class for bad_pattern is moot; + depending upon how the library is used exceptions may be either logic errors + (programmer supplied expressions) or run time errors (user supplied + expressions).
+ +Revised - + 11 April 2003 - -
-© Copyright John Maddock 1998- 2003
-Permission to use, copy, modify, distribute and sell this software +
+© Copyright John Maddock 1998- + + 2003 +
+Permission to use, copy, modify, distribute and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. Dr John Maddock makes no representations about the suitability of this software - for any purpose. It is provided "as is" without express or implied warranty.
+ for any purpose. It is provided "as is" without express or implied warranty. diff --git a/doc/Attic/basic_regex.html b/doc/Attic/basic_regex.html index 0a7a2775..bca08197 100644 --- a/doc/Attic/basic_regex.html +++ b/doc/Attic/basic_regex.html @@ -2,57 +2,57 @@-
- |
-
- Boost.Regex-basic_regex- |
-
- |
-
#include <boost/regex.hpp>-
The template class basic_regex encapsulates regular expression parsing - and compilation. The class takes three template parameters: -
-charT: determines the character type, i.e. either char or - wchar_t. -
-traits: determines the behaviour of the character type, for +
+ |
+
+ Boost.Regex+basic_regex+ |
+
+ |
+
+#include <boost/regex.hpp> ++
The template class basic_regex encapsulates regular expression parsing + and compilation. The class takes three template parameters:
+charT: determines the character type, i.e. either char or + wchar_t.
+traits: determines the behavior of the character type, for example which character class names are recognized. A default traits class is - provided: regex_traits<charT>. -
-Allocator: the allocator class used to allocate memory by the - class. -
-For ease of use there are two typedefs that define the two standard basic_regex + provided: regex_traits<charT>.
+Allocator: the allocator class used to allocate memory by the + class.
+For ease of use there are two typedefs that define the two standard basic_regex instances, unless you want to use custom traits classes or allocators, you - won't need to use anything other than these: -
-namespace boost{ -template <class charT, class traits = regex_traits<charT>, class Allocator = std::allocator<charT> > -class reg_expression; -typedef reg_expression<char> regex; -typedef reg_expression<wchar_t> wregex; -}-
The definition of reg_expression follows: it is based very closely on - class basic_string, and fulfils the requirements for a constant-container of charT. -
-namespace boost{ + won't need to use anything other than these: +++namespace boost{ +template <class charT, class traits = regex_traits<charT>, class Allocator = std::allocator<charT> > +class basic_regex; +typedef basic_regex<char> regex; +typedef basic_regex<wchar_t> wregex; +} ++The definition of basic_regex follows: it is based very closely on class + basic_string, and fulfils the requirements for a constant-container of charT.
++namespace boost{ template <class charT, class traits = regex_traits<charT>, @@ -180,12 +180,13 @@ void swap(basic_regex<charT, traits, Allocator>& e1, typedef basic_regex<char> regex; typedef basic_regex<wchar_t> wregex; -} // namespace boost-Description
-Class basic_regex has the following public member functions: -
-basic_regex constants
-static const regex_constants::syntax_option_type normal = regex_constants::normal; +} // namespace boost ++Description
+Class basic_regex has the following public member functions:
+basic_regex constants
++static const regex_constants::syntax_option_type normal = regex_constants::normal; static const regex_constants::syntax_option_type icase = regex_constants::icase; static const regex_constants::syntax_option_type nosubs = regex_constants::nosubs; static const regex_constants::syntax_option_type optimize = regex_constants::optimize; @@ -199,746 +200,790 @@ static const regex_constants::syntax_option_type awk = regex_constants::awk; static const regex_constants::syntax_option_type grep = regex_constants::grep; static const regex_constants::syntax_option_type egrep = regex_constants::egrep; static const regex_constants::syntax_option_type sed = basic = regex_constants::sed; -static const regex_constants::syntax_option_type perl = regex_constants::perl;-The static constant members are provided as synonyms for the constants declared - in namespace
-boost::regex_constants
; for each constant of typesyntax_option_type
- declared in namespaceboost::regex_constants
then a constant with - the same name, type and value is declared within the scope ofbasic_regex
.basic_regex constructors
-In all
basic_regex
constructors, a copy of theAllocator
+static const regex_constants::syntax_option_type perl = regex_constants::perl; +
The static constant members are provided as synonyms for the constants declared
+ in namespace boost::regex_constants
; for each constant of type syntax_option_type
+ declared in namespace boost::regex_constants
then a constant with
+ the same name, type and value is declared within the scope of basic_regex
.
In all basic_regex
constructors, a copy of the Allocator
argument is used for any memory allocation performed by the constructor or
- member functions during the lifetime of the object.
-
basic_regex(const Allocator& a = Allocator());- -
- Effects: Constructs an object of class basic_regex
. The
- postconditions of this function are indicated in the table:
-
-
- - Element - - |
-
- - Value |
-
- empty() - |
-
- true - |
-
- size() - |
-
- 0 - |
-
- str() - |
-
- basic_string<charT>() - - |
-
basic_regex(const charT* p, flag_type f = regex_constants::normal, const Allocator& a = Allocator());- -
- Requires: p shall not be a null pointer.
-
- Throws: bad_expression
if p is not a valid regular
- expression.
- Effects: Constructs an object of class basic_regex
; the
- object's internal finite state machine is constructed from the regular
- expression contained in the null-terminated string p, and interpreted
- according to the option flags specified
- in f. The postconditions of this function are indicated in the
- table:
-
-
- - Element - - |
-
- - Value |
-
- empty() - |
-
- false - |
-
- size() - |
-
- char_traits<charT>::length(p) - |
-
- str() - |
-
- basic_string<charT>(p) - |
-
- getflags() - |
-
- f - |
-
- mark_count() - |
-
- The number of marked sub-expressions within the expression. - - |
-
basic_regex(const charT* p1, const charT* p2, flag_type f = regex_constants::normal, const Allocator& a = Allocator());- -
- Requires: p1 and p2 are not null pointers, p1 < p2
.
- Throws: bad_expression
if [p1,p2) is not a valid regular
- expression.
- Effects: Constructs an object of class basic_regex
; the
- object's internal finite state machine is constructed from the regular
- expression contained in the sequence of characters [p1,p2), and interpreted
- according the option flags specified in f.
- The postconditions of this function are indicated in the table:
-
-
- - Element - - |
-
- - Value |
-
- empty() - |
-
- false - |
-
- size() - |
-
- std::distance(p1,p2) - |
-
- str() - |
-
- basic_string<charT>(p1,p2) - |
-
- getflags() - |
-
- f - |
-
- mark_count() - |
-
- The number of marked sub-expressions within the expression. - - |
-
basic_regex(const charT* p, size_type len, flag_type f, const Allocator& a = Allocator());- -
- Requires: p shall not be a null pointer, len < max_size()
.
- Throws: bad_expression
if p is not a valid regular
- expression.
- Effects: Constructs an object of class basic_regex
; the
- object's internal finite state machine is constructed from the regular
- expression contained in the sequence of characters [p, p+len), and interpreted
- according the option flags specified in f.
- The postconditions of this function are indicated in the table:
-
-
- - Element - - |
-
- - Value |
-
- empty() - |
-
- false - |
-
- size() - |
-
- len - |
-
- str() - |
-
- basic_string<charT>(p, len) - |
-
- getflags() - |
-
- f - |
-
- mark_count() - |
-
- The number of marked sub-expressions within the expression. - - |
-
basic_regex(const basic_regex& e);- -
- Effects: Constructs an object of class basic_regex
as a
- copy of the object e. The postconditions of this function are indicated
- in the table:
-
-
- - Element - - |
-
- - Value |
-
- empty() - |
-
- e.empty() - |
-
- size() - |
-
- e.size() - |
-
- str() - |
-
- e.str() - |
-
- getflags() - |
-
- e.getflags() - |
-
- mark_count() - |
-
- e.mark_count() - - |
-
template <class ST, class SA> + member functions during the lifetime of the object. ++ ++basic_regex(const Allocator& a = Allocator()); ++ +Effects: Constructs an object of class
+basic_regex
. The + postconditions of this function are indicated in the table:+
+ +++ ++ +
++ ++ +Element
++ +Value
++ ++ +empty()
++ +true
++ ++ +size()
++ +0
++ + ++ +str()
++ +basic_string<charT>()
+++basic_regex(const charT* p, flag_type f = regex_constants::normal, const Allocator& a = Allocator()); ++ +Requires: p shall not be a null pointer.
+ +Throws:
+ +bad_expression
if p is not a valid regular + expression.Effects: Constructs an object of class
+ +basic_regex
; the + object's internal finite state machine is constructed from the regular + expression contained in the null-terminated string p, and interpreted + according to the option flags specified + in f. The postconditions of this function are indicated in the table:+
+ +++ ++ +
++ ++ +Element
++ +Value
++ ++ +empty()
++ +false
++ ++ +size()
++ +char_traits<charT>::length(p)
++ ++ +str()
++ +basic_string<charT>(p)
++ ++ +getflags()
++ +f
++ + ++ +mark_count()
++ +The number of marked sub-expressions within the expression.
+++basic_regex(const charT* p1, const charT* p2, flag_type f = regex_constants::normal, const Allocator& a = Allocator()); ++ +Requires: p1 and p2 are not null pointers,
+ +p1 < p2
.Throws:
+ +bad_expression
if [p1,p2) is not a valid regular + expression.Effects: Constructs an object of class
+ +basic_regex
; the + object's internal finite state machine is constructed from the regular + expression contained in the sequence of characters [p1,p2), and interpreted + according the option flags specified in f. + The postconditions of this function are indicated in the table:+
+ +++ ++ +
++ ++ +Element
++ +Value
++ ++ +empty()
++ +false
++ ++ +size()
++ +std::distance(p1,p2)
++ ++ +str()
++ +basic_string<charT>(p1,p2)
++ ++ +getflags()
++ +f
++ + ++ +mark_count()
++ +The number of marked sub-expressions within the expression.
+++basic_regex(const charT* p, size_type len, flag_type f, const Allocator& a = Allocator()); ++ +Requires: p shall not be a null pointer,
+ +len < max_size()
.Throws:
+ +bad_expression
if p is not a valid regular + expression.Effects: Constructs an object of class
+ +basic_regex
; the + object's internal finite state machine is constructed from the regular + expression contained in the sequence of characters [p, p+len), and interpreted + according the option flags specified in f. + The postconditions of this function are indicated in the table:+
+ +++ ++ +
++ ++ +Element
++ +Value
++ ++ +empty()
++ +false
++ ++ +size()
++ +len
++ ++ +str()
++ +basic_string<charT>(p, len)
++ ++ +getflags()
++ +f
++ + ++ +mark_count()
++ +The number of marked sub-expressions within the expression.
+++basic_regex(const basic_regex& e); ++ +Effects: Constructs an object of class
+ +basic_regex
as a + copy of the object e. The postconditions of this function are indicated + in the table:+
+ +++ ++ +
++ ++ +Element
++ +Value
++ ++ +empty()
++ +e.empty()
++ ++ +size()
++ +e.size()
++ ++ +str()
++ +e.str()
++ ++ +getflags()
++ +e.getflags()
++ + ++ +mark_count()
++ +e.mark_count()
+++template <class ST, class SA> basic_regex(const basic_string<charT, ST, SA>& s, - flag_type f = regex_constants::normal, const Allocator& a = Allocator());- -- Throws:
-bad_expression
if s is not a valid regular - expression.- Effects: Constructs an object of class
-basic_regex
; the - object's internal finite state machine is constructed from the regular - expression contained in the string s, and interpreted according to the - option flags specified in f. The postconditions of this function - are indicated in the table:-
- - --
- - -- -
- -- -- Element -
-- -- Value
- -- -empty()
-- -false
-- -- -size()
-- -s.size()
-- -- -str()
-- -s
-- -- -getflags()
-- -f
-- -- -mark_count()
-- -The number of marked sub-expressions within the expression.
- -template <class ForwardIterator> + flag_type f = regex_constants::normal, const Allocator& a = Allocator()); ++ +Throws:
+ +bad_expression
if s is not a valid regular + expression.Effects: Constructs an object of class
+ +basic_regex
; the + object's internal finite state machine is constructed from the regular + expression contained in the string s, and interpreted according to the + option flags specified in f. The postconditions of this function + are indicated in the table:+
+ +++ ++ +
++ ++ +Element
++ +Value
++ ++ +empty()
++ +false
++ ++ +size()
++ +s.size()
++ ++ +str()
++ +s
++ ++ +getflags()
++ +f
++ + ++ +mark_count()
++ +The number of marked sub-expressions within the expression.
+++template <class ForwardIterator> basic_regex(ForwardIterator first, ForwardIterator last, - flag_type f = regex_constants::normal, const Allocator& a = Allocator());- -- Throws:
-bad_expression
if the sequence [first, last) - is not a valid regular expression.- Effects: Constructs an object of class
-basic_regex
; the - object's internal finite state machine is constructed from the regular - expression contained in the sequence of characters [first, last), and - interpreted according to the option flags - specified in f. The postconditions of this function are indicated in the - table:-
- - --
- - -- -
- -- -- Element -
-- -- Value
- -- -empty()
-- -false
-- -- -size()
-- -distance(first,last)
-- -- -str()
-- -basic_string<charT>(first,last)
-- -- -getflags()
-- -f
-- -- -mark_count()
-- -The number of marked sub-expressions within the expression.
- -basic_regex& operator=(const basic_regex& e);- -- Effects: Returns the result of
assign(e.str(), e.getflags())
.basic_regex& operator=(const charT* ptr);- -- Requires: p shall not be a null pointer.
-- Effects: Returns the result of
assign(ptr)
.template <class ST, class SA> -basic_regex& operator=(const basic_string<charT, ST, SA>& p);- -- Effects: Returns the result of
-assign(p)
.basic_regex iterators
-const_iterator begin() const;- -- Effects: Returns a starting iterator to a sequence of characters - representing the regular expression.
const_iterator end() const;- -- Effects: Returns termination iterator to a sequence of characters - representing the regular expression.
-basic_regex capacity
-size_type size() const;- -- Effects: Returns the length of the sequence of characters representing - the regular expression.
size_type max_size() const;- -- Effects: Returns the maximum length of the sequence of characters - representing the regular expression.
bool empty() const;- -- Effects: Returns true if the object does not contain a valid - regular expression, otherwise false.
unsigned mark_count() const;- -- Effects: Returns the number of marked sub-expressions within the regular - expresion.
-basic_regex assign
-basic_regex& assign(const basic_regex& that);- -- Effects: Returns
assign(that.str(), that.getflags())
.basic_regex& assign(const charT* ptr, flag_type f = regex_constants::normal);- -- Effects: Returns
assign(string_type(ptr), f)
.basic_regex& assign(const charT* first, const charT* last, - flag_type f = regex_constants::normal);- -- Effects: Returns
assign(string_type(first, last), f)
.template <class string_traits, class A> + flag_type f = regex_constants::normal, const Allocator& a = Allocator()); ++ +Throws:
+ +bad_expression
if the sequence [first, last) + is not a valid regular expression.Effects: Constructs an object of class
+ +basic_regex
; the + object's internal finite state machine is constructed from the regular + expression contained in the sequence of characters [first, last), and + interpreted according to the option flags + specified in f. The postconditions of this function are indicated in the + table:+
+ +++ ++ +
++ ++ +Element
++ +Value
++ ++ +empty()
++ +false
++ ++ +size()
++ +distance(first,last)
++ ++ +str()
++ +basic_string<charT>(first,last)
++ ++ +getflags()
++ +f
++ + ++ +mark_count()
++ +The number of marked sub-expressions within the expression.
+++basic_regex& operator=(const basic_regex& e); ++ +Effects: Returns the result of
+assign(e.str(), e.getflags())
.+basic_regex& operator=(const charT* ptr); ++ +Requires: p shall not be a null pointer.
+ +Effects: Returns the result of
+assign(ptr)
.+template <class ST, class SA> +basic_regex& operator=(const basic_string<charT, ST, SA>& p); ++ +Effects: Returns the result of
+assign(p)
.basic_regex iterators
++const_iterator begin() const; ++ +Effects: Returns a starting iterator to a sequence of characters + representing the regular expression.
++const_iterator end() const; ++ +Effects: Returns termination iterator to a sequence of characters + representing the regular expression.
+basic_regex capacity
++size_type size() const; ++ +Effects: Returns the length of the sequence of characters representing + the regular expression.
++size_type max_size() const; ++ +Effects: Returns the maximum length of the sequence of characters + representing the regular expression.
++bool empty() const; ++ +Effects: Returns true if the object does not contain a valid + regular expression, otherwise false.
++unsigned mark_count() const; ++ +Effects: Returns the number of marked sub-expressions within the regular + expresion.
+basic_regex assign
++basic_regex& assign(const basic_regex& that); ++ +Effects: Returns
+assign(that.str(), that.getflags())
.+basic_regex& assign(const charT* ptr, flag_type f = regex_constants::normal); ++ +Effects: Returns
+assign(string_type(ptr), f)
.+basic_regex& assign(const charT* first, const charT* last, + flag_type f = regex_constants::normal); ++ +Effects: Returns
+assign(string_type(first, last), f)
.+template <class string_traits, class A> basic_regex& assign(const basic_string<charT, string_traits, A>& s, - flag_type f = regex_constants::normal);- -- Throws:
-bad_expression
if s is not a valid regular - expression.- Returns:
-*this
.- Effects: Assigns the regular expression contained in the string s, - interpreted according the option flags specified - in f. The postconditions of this function are indicated in the - table:
--
- - --
- - -- -
- -- -- Element -
-- -- Value
- -- -empty()
-- -false
-- -- -size()
-- -s.size()
-- -- -str()
-- -s
-- -- -getflags()
-- -f
-- -- -mark_count()
-- -The number of marked sub-expressions within the expression.
- -template <class InputIterator> + flag_type f = regex_constants::normal); ++ +Throws:
+ +bad_expression
if s is not a valid regular + expression.Returns:
+ +*this
.Effects: Assigns the regular expression contained in the string s, + interpreted according the option flags specified + in f. The postconditions of this function are indicated in the table:
+ ++
+ +++ ++ +
++ ++ +Element
++ +Value
++ ++ +empty()
++ +false
++ ++ +size()
++ +s.size()
++ ++ +str()
++ +s
++ ++ +getflags()
++ +f
++ + ++ +mark_count()
++ +The number of marked sub-expressions within the expression.
+++template <class InputIterator> basic_regex& assign(InputIterator first, InputIterator last, - flag_type f = regex_constants::normal);- -- Requires: The type InputIterator corresponds to the Input Iterator - requirements (24.1.1).
-- Effects: Returns
-assign(string_type(first, last), f)
.basic_regex constant operations
-Allocator get_allocator() const;- -- Effects: Returns a copy of the Allocator that was passed to the object's - constructor.
flag_type getflags() const;- -- Effects: Returns a copy of the regular expression syntax flags that were - passed to the object's constructor, or the last call to
assign.
basic_string<charT> str() const;- -- Effects: Returns a copy of the character sequence passed to the object's - constructor, or the last call to
assign.
int compare(basic_regex& e)const;- -- Effects: If
-getflags() == e.getflags()
then returnsstr().compare(e.str())
, - otherwise returnsgetflags() - e.getflags()
.basic_regex locale
-locale_type imbue(locale_type l);- -- Effects: Returns the result of
-traits_inst.imbue(l)
where- traits_inst
is a (default initialized) instance of the template - parametertraits
stored within the object. Calls to imbue - invalidate any currently contained regular expression.- Postcondition:
empty() == true
.locale_type getloc() const;- -- Effects: Returns the result of
-traits_inst.getloc()
where- traits_inst
is a (default initialized) instance of the template - parametertraits
stored within the object.basic_regex swap
-void swap(basic_regex& e) throw();- -- Effects: Swaps the contents of the two regular expressions.
-- Postcondition:
-*this
contains the characters that were in e, - e contains the regular expression that was in*this
.- Complexity: constant time.
-basic_regex non-member functions
-basic_regex non-member comparison operators
-template <class charT, class traits, class Allocator> + flag_type f = regex_constants::normal); ++ +Requires: The type InputIterator corresponds to the Input Iterator + requirements (24.1.1).
+ +Effects: Returns
+assign(string_type(first, last), f)
.basic_regex constant operations
++Allocator get_allocator() const; ++ +Effects: Returns a copy of the Allocator that was passed to the object's + constructor.
++flag_type getflags() const; ++ +Effects: Returns a copy of the regular expression syntax flags that were + passed to the object's constructor, or the last call to
+assign.
+basic_string<charT> str() const; ++ +Effects: Returns a copy of the character sequence passed to the object's + constructor, or the last call to
+assign.
+int compare(basic_regex& e)const; ++ +Effects: If
+getflags() == e.getflags()
then returnsstr().compare(e.str())
, + otherwise returnsgetflags() - e.getflags()
.basic_regex locale
++locale_type imbue(locale_type l); ++ +Effects: Returns the result of
+ +traits_inst.imbue(l)
where+ traits_inst
is a (default initialized) instance of the template + parametertraits
stored within the object. Calls to imbue + invalidate any currently contained regular expression.Postcondition:
+empty() == true
.+locale_type getloc() const; ++ +Effects: Returns the result of
+traits_inst.getloc()
where+ traits_inst
is a (default initialized) instance of the template + parametertraits
stored within the object.basic_regex swap
++void swap(basic_regex& e) throw(); ++ +Effects: Swaps the contents of the two regular expressions.
+ +Postcondition:
+ +*this
contains the characters that were in e, + e contains the regular expression that was in*this
.Complexity: constant time.
+basic_regex non-member functions
+basic_regex non-member comparison operators
++template <class charT, class traits, class Allocator> bool operator == (const basic_regex<charT, traits, Allocator>& lhs, - const basic_regex<charT, traits, Allocator>& rhs);- -- Effects: Returns
lhs.compare(rhs) == 0
.template <class charT, class traits, class Allocator> + const basic_regex<charT, traits, Allocator>& rhs); ++ +Effects: Returns
+lhs.compare(rhs) == 0
.+template <class charT, class traits, class Allocator> bool operator != (const basic_regex<charT, traits, Allocator>& lhs, - const basic_regex<charT, traits, Allocator>& rhs);- -- Effects: Returns
lhs.compare(rhs) != 0
.template <class charT, class traits, class Allocator> + const basic_regex<charT, traits, Allocator>& rhs); ++ +Effects: Returns
+lhs.compare(rhs) != 0
.+template <class charT, class traits, class Allocator> bool operator < (const basic_regex<charT, traits, Allocator>& lhs, - const basic_regex<charT, traits, Allocator>& rhs);- -- Effects: Returns
lhs.compare(rhs) < 0
.template <class charT, class traits, class Allocator> + const basic_regex<charT, traits, Allocator>& rhs); ++ +Effects: Returns
+lhs.compare(rhs) < 0
.+template <class charT, class traits, class Allocator> bool operator <= (const basic_regex<charT, traits, Allocator>& lhs, - const basic_regex<charT, traits, Allocator>& rhs);- -- Effects: Returns
lhs.compare(rhs) <= 0
.template <class charT, class traits, class Allocator> + const basic_regex<charT, traits, Allocator>& rhs); ++ +Effects: Returns
+lhs.compare(rhs) <= 0
.+template <class charT, class traits, class Allocator> bool operator >= (const basic_regex<charT, traits, Allocator>& lhs, - const basic_regex<charT, traits, Allocator>& rhs);- -- Effects: Returns
lhs.compare(rhs) >= 0
.template <class charT, class traits, class Allocator> + const basic_regex<charT, traits, Allocator>& rhs); ++ +Effects: Returns
+lhs.compare(rhs) >= 0
.+template <class charT, class traits, class Allocator> bool operator > (const basic_regex<charT, traits, Allocator>& lhs, - const basic_regex<charT, traits, Allocator>& rhs);- -- Effects: Returns
-lhs.compare(rhs) > 0
.basic_regex inserter.
-template <class charT, class io_traits, class re_traits, class Allocator> + const basic_regex<charT, traits, Allocator>& rhs); ++ +Effects: Returns
+lhs.compare(rhs) > 0
.basic_regex inserter.
++template <class charT, class io_traits, class re_traits, class Allocator> basic_ostream<charT, io_traits>& operator << (basic_ostream<charT, io_traits>& os - const basic_regex<charT, re_traits, Allocator>& e);- -- Effects: Returns (os << e.str()).
-basic_regex non-member swap
-template <class charT, class traits, class Allocator> + const basic_regex<charT, re_traits, Allocator>& e); ++ +Effects: Returns (os << e.str()).
+basic_regex non-member swap
++template <class charT, class traits, class Allocator> void swap(basic_regex<charT, traits, Allocator>& lhs, - basic_regex<charT, traits, Allocator>& rhs);- -- Effects: calls
-lhs.swap(rhs)
.-
- + basic_regex<charT, traits, Allocator>& rhs); +
Effects: calls lhs.swap(rhs)
.
Revised 11 April 2003 - -
-© Copyright John Maddock 1998- 2003
-Permission to use, copy, modify, distribute and sell this software +
+© Copyright John Maddock 1998- + + 2003 +
+Permission to use, copy, modify, distribute and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. Dr John Maddock makes no representations about the suitability of this software - for any purpose. It is provided "as is" without express or implied warranty.
+ for any purpose. It is provided "as is" without express or implied warranty. diff --git a/doc/Attic/configuration.html b/doc/Attic/configuration.html index 7cb8dfa8..0d3e2eb2 100644 --- a/doc/Attic/configuration.html +++ b/doc/Attic/configuration.html @@ -1,163 +1,245 @@ - --
- |
-
- Boost.Regex-Configuration and setup- |
-
- |
-
You shouldn't need to do anything special to configure boost.regex for use with - your compiler - the boost.config subsystem - should already take care of it, if you do have problems (or you are using a - particularly obscure compiler or platform) then boost.config has - a configure script.
-The following macros (see user.hpp) - control how boost.regex interacts with the users locale:
--
BOOST_REGEX_USE_C_LOCALE | -Forces boost.regex to use the global C locale in it's traits class support: - this is the default behaviour on non-windows platforms, but MS Windows - platforms normally use the Win32 API for locale support. | -
BOOST_REGEX_USE_CPP_LOCALE | -Forces boost.regex to use std::locale in it's default traits class, regular - expressions can then be imbued with an instance specific locale. | -
BOOST_REGEX_NO_W32 | -Tells boost.regex not to use any Win32 API's even when available (implies - BOOST_REGEX_USE_C_LOCALE unless BOOST_REGEX_USE_CPP_LOCALE is set). | -
-
BOOST_REGEX_STATIC_LINK | -For Microsoft and Borland C++ builds, this tells boost.regex that it is going - to be linked to a static library even when using a dynamic C runtime. | -
BOOST_REGEX_NO_LIB | -For Microsoft and Borland C++ builds, this tells boost.regex that it should - not automatically select the library to link to. | -
-
BOOST_REGEX_V3 | -Tells boost.regex to use the boost-1.30.0 matching algorithm, define only if - you need maximum compatibility with previous behaviour. | -
BOOST_REGEX_RECURSIVE | -Tells boost.regex to use a stack-recursive matching algorithm. This is - generally the fastest option (although there is very little in it), but can - cause stack overflow in extreme cases, on Win32 this can be handled safely, but - this is not the case on other platforms. | -
BOOST_REGEX_NON_RECURSIVE | -Tells boost.regex to use a non-stack recursive matching algorithm, this can be - slightly slower than the alternative, but is always safe no matter how - pathological the regular expression. This is the default on non-Win32 - platforms. | -
The following option applies only if BOOST_REGEX_RECURSIVE is set.
--
BOOST_REGEX_HAS_MS_STACK_GUARD | -Tells boost.regex that Microsoft style __try - __except blocks are supported, - and can be used to safely trap stack overflow. | -
The following options apply only if BOOST_REGEX_NON_RECURSIVE is set.
--
BOOST_REGEX_BLOCKSIZE | -In non-recursive mode, boost.regex uses largish blocks of memory to act as a - stack for the state machine, the larger the block size then the fewer - allocations that will take place. This defaults to 4096 bytes, which is - large enough to match the vast majority of regular expressions without - further allocations, however, you can choose smaller or larger values depending - upon your platforms characteristics. | -
BOOST_REGEX_MAX_BLOCKS | -Tells boost.regex how many blocks of size BOOST_REGEX_BLOCKSIZE it is - permitted to use. If this value is exceeded then boost.regex will stop - trying to find a match and throw a std::runtime_error. Defaults to 1024, - don't forget to tweek this value if you alter BOOST_REGEX_BLOCKSIZE by much. | -
BOOST_REGEX_MAX_CACHE_BLOCKS | -Tells boost.regex how many memory blocks to store in it's internal cache - - memory blocks are taken from this cache rather than by calling ::operator - new. Generally speeking this can be an order of magnitude faster than - calling ::opertator new each time a memory block is required, but has the - downside that boost.regex can end up caching a large chunk of memory (by - default up to 16 blocks each of BOOST_REGEX_BLOCKSIZE size). If memory is - tight then try defining this to 0 (disables all caching), or if that is too - slow, then a value of 1 or 2, may be sufficient. On the other hand, on - large multi-processor, multi-threaded systems, you may find that a higher value - is in order. | -
-
Revised - - 11 April 2003 - -
-© Copyright John Maddock 1998- 2003
-Permission to use, copy, modify, distribute and sell this software - and its documentation for any purpose is hereby granted without fee, provided - that the above copyright notice appear in all copies and that both that - copyright notice and this permission notice appear in supporting documentation. - Dr John Maddock makes no representations about the suitability of this software - for any purpose. It is provided "as is" without express or implied warranty.
- + +
+ |
+
+Boost.Regex+ +Configuration and setup+ |
+
+ |
+
You shouldn't need to do anything special to configure +boost.regex for use with your compiler - the boost.config subsystem should already +take care of it, if you do have problems (or you are using a +particularly obscure compiler or platform) then boost.config has a configure script.
+ +The following macros (see user.hpp) control how +boost.regex interacts with the user's locale:
+ + + +BOOST_REGEX_USE_C_LOCALE | +Forces boost.regex to use the global C locale in its traits +class support: this is the default behavior on non-windows +platforms, but MS Windows platforms normally use the Win32 API for +locale support. | +
BOOST_REGEX_USE_CPP_LOCALE | +Forces boost.regex to use std::locale in it's default traits +class, regular expressions can then be imbued with an +instance specific locale. | +
BOOST_REGEX_NO_W32 | +Tells boost.regex not to use any Win32 API's even when +available (implies BOOST_REGEX_USE_C_LOCALE unless +BOOST_REGEX_USE_CPP_LOCALE is set). | +
BOOST_REGEX_DYN_LINK | +For Microsoft and Borland C++ builds, this tells + boost.regex that it should link to the dll build of the boost.regex. By default +boost.regex will link to its static library build, even if the dynamic C runtime library +is in use. | +
BOOST_REGEX_NO_LIB | +For Microsoft and Borland C++ builds, this tells boost.regex +that it should not automatically select the library to link +to. | +
BOOST_REGEX_V3 | +Tells boost.regex to use the boost-1.30.0 matching algorithm, +define only if you need maximum compatibility with previous +behavior. | +
BOOST_REGEX_RECURSIVE | +Tells boost.regex to use a stack-recursive matching +algorithm. This is generally the fastest option (although +there is very little in it), but can cause stack overflow in +extreme cases, on Win32 this can be handled safely, but this is not +the case on other platforms. | +
BOOST_REGEX_NON_RECURSIVE | +Tells boost.regex to use a non-stack recursive matching +algorithm, this can be slightly slower than the alternative, but is +always safe no matter how pathological the regular +expression. This is the default on non-Win32 platforms. | +
The following option applies only if BOOST_REGEX_RECURSIVE is +set.
+ + + +BOOST_REGEX_HAS_MS_STACK_GUARD | +Tells boost.regex that Microsoft style __try - __except blocks +are supported, and can be used to safely trap stack overflow. | +
The following options apply only if BOOST_REGEX_NON_RECURSIVE is +set.
+ + + +BOOST_REGEX_BLOCKSIZE | +In non-recursive mode, boost.regex uses largish blocks of +memory to act as a stack for the state machine, the larger the +block size then the fewer allocations that will take place. +This defaults to 4096 bytes, which is large enough to match the +vast majority of regular expressions without further +allocations, however, you can choose smaller or larger values +depending upon your platforms characteristics. | +
BOOST_REGEX_MAX_BLOCKS | +Tells boost.regex how many blocks of size BOOST_REGEX_BLOCKSIZE +it is permitted to use. If this value is exceeded then +boost.regex will stop trying to find a match and throw a +std::runtime_error. Defaults to 1024, don't forget to tweek +this value if you alter BOOST_REGEX_BLOCKSIZE by much. | +
BOOST_REGEX_MAX_CACHE_BLOCKS | +Tells boost.regex how many memory blocks to store in it's +internal cache - memory blocks are taken from this cache rather +than by calling ::operator new. Generally speeking this can +be an order of magnitude faster than calling ::opertator new each +time a memory block is required, but has the downside that +boost.regex can end up caching a large chunk of memory (by default +up to 16 blocks each of BOOST_REGEX_BLOCKSIZE size). If +memory is tight then try defining this to 0 (disables all caching), +or if that is too slow, then a value of 1 or 2, may be +sufficient. On the other hand, on large multi-processor, +multi-threaded systems, you may find that a higher value is in +order. | +
Revised +11 +April 2003 +
+ +© Copyright John +Maddock 1998- +2003 +
+ +Permission to use, copy, modify, distribute and +sell this software and its documentation for any purpose is hereby +granted without fee, provided that the above copyright notice +appear in all copies and that both that copyright notice and this +permission notice appear in supporting documentation. Dr John +Maddock makes no representations about the suitability of this +software for any purpose. It is provided "as is" without express or +implied warranty.
+ diff --git a/doc/Attic/contacts.html b/doc/Attic/contacts.html index 1f256990..25038d8a 100644 --- a/doc/Attic/contacts.html +++ b/doc/Attic/contacts.html @@ -1,86 +1,111 @@ - --
- |
-
- Boost.Regex-Contacts and Acknowledgements- |
-
- |
-
The author can be contacted at John_Maddock@compuserve.com, - the home page for this library is at - http://ourworld.compuserve.com/homepages/John_Maddock/regexpp.htm, and - the official boost version can be obtained from www.boost.org/libraries.htm. -
-I am indebted to Robert Sedgewick's "Algorithms in C++" for forcing me to think - about algorithms and their performance, and to the folks at boost for forcing - me to think, period. The following people have all contributed useful - comments or fixes: Dave Abrahams, Mike Allison, Edan Ayal, Jayashree - Balasubramanian, Jan Bölsche, Beman Dawes, Paul Baxter, David Bergman, David - Dennerline, Edward Diener, Peter Dimov, Robert Dunn, Fabio Forno, Tobias - Gabrielsson, Rob Gillen, Marc Gregoire, Chris Hecker, Nick Hodapp, Jesse Jones, - Martin Jost, Boris Krasnovskiy, Jan Hermelink, Max Leung, Wei-hao Lin, Jens - Maurer, Richard Peters, Heiko Schmidt, Jason Shirk, Gerald Slacik, Scobie - Smith, Mike Smyth, Alexander Sokolovsky, Hervé Poirier, Michael Raykh, Marc - Recht, Scott VanCamp, Bruno Voigt, Alexey Voinov, Jerry Waldorf, Rob Ward, - Lealon Watts, Thomas Witt and Yuval Yosef. I am also grateful to the manuals - supplied with the Henry Spencer, Perl and GNU regular expression libraries - - wherever possible I have tried to maintain compatibility with these libraries - and with the POSIX standard - the code however is entirely my own, including - any bugs! I can absolutely guarantee that I will not fix any bugs I don't know - about, so if you have any comments or spot any bugs, please get in touch. -
-Useful further information can be found at: -
-A short tutorial on regular expressions - can be found here.
-The Open Unix - Specification contains a wealth of useful material, including the - regular expression syntax, and specifications for - <regex.h> and - <nl_types.h>. -
-The Pattern Matching Pointers - site is a "must visit" resource for anyone interested in pattern matching. -
-Glimpse and Agrep, use a - simplified regular expression syntax to achieve faster search times. -
-Udi Manber and - Ricardo Baeza-Yates - both have a selection of useful pattern matching papers available from their - respective web sites. -
-
Revised - - 11 April 2003 - -
-© Copyright John Maddock 1998- 2003
-Permission to use, copy, modify, distribute and sell this software - and its documentation for any purpose is hereby granted without fee, provided - that the above copyright notice appear in all copies and that both that - copyright notice and this permission notice appear in supporting documentation. - Dr John Maddock makes no representations about the suitability of this software - for any purpose. It is provided "as is" without express or implied warranty.
- + +
+ |
+
+Boost.Regex+ +Contacts and Acknowledgements+ |
+
+ |
+
The author can be contacted at +john_maddock@compuserve.com, the home page for this library is +at +http://ourworld.compuserve.com/homepages/john_maddock/regexpp.htm, +and the official boost version can be obtained from www.boost.org/libraries.htm.
+ +I am indebted to Robert Sedgewick's "Algorithms in C++" for +forcing me to think about algorithms and their performance, and to +the folks at boost for forcing me to think, period. The +following people have all contributed useful comments or fixes: +Dave Abrahams, Mike Allison, Edan Ayal, Jayashree Balasubramanian, +Jan Bölsche, Beman Dawes, Paul Baxter, David Bergman, David +Dennerline, Edward Diener, Peter Dimov, Robert Dunn, Fabio Forno, +Tobias Gabrielsson, Rob Gillen, Marc Gregoire, Chris Hecker, Nick +Hodapp, Jesse Jones, Martin Jost, Boris Krasnovskiy, Jan Hermelink, +Max Leung, Wei-hao Lin, Jens Maurer, Richard Peters, Heiko Schmidt, +Jason Shirk, Gerald Slacik, Scobie Smith, Mike Smyth, Alexander +Sokolovsky, Hervé Poirier, Michael Raykh, Marc Recht, Scott +VanCamp, Bruno Voigt, Alexey Voinov, Jerry Waldorf, Rob Ward, +Lealon Watts, Thomas Witt and Yuval Yosef. I am also grateful to +the manuals supplied with the Henry Spencer, Perl and GNU regular +expression libraries - wherever possible I have tried to maintain +compatibility with these libraries and with the POSIX standard - +the code however is entirely my own, including any bugs! I can +absolutely guarantee that I will not fix any bugs I don't know +about, so if you have any comments or spot any bugs, please get in +touch.
+ +Useful further information can be found at:
+ +A short tutorial on regular expressions can be +found here.
+ +The Open Unix +Specification contains a wealth of useful material, including +the regular expression syntax, and specifications for +<regex.h> and +<nl_types.h>.
+ +The Pattern +Matching Pointers site is a "must visit" resource for anyone +interested in pattern matching.
+ +Glimpse and Agrep, +use a simplified regular expression syntax to achieve faster search +times.
+ +Udi Manber +and Ricardo +Baeza-Yates both have a selection of useful pattern matching +papers available from their respective web sites.
+ + + +Revised +11 +April 2003 +
+ +© Copyright John +Maddock 1998- +2003 +
+ +Permission to use, copy, modify, distribute and +sell this software and its documentation for any purpose is hereby +granted without fee, provided that the above copyright notice +appear in all copies and that both that copyright notice and this +permission notice appear in supporting documentation. Dr John +Maddock makes no representations about the suitability of this +software for any purpose. It is provided "as is" without express or +implied warranty.
+ diff --git a/doc/Attic/examples.html b/doc/Attic/examples.html index b8d61d2d..4e032d00 100644 --- a/doc/Attic/examples.html +++ b/doc/Attic/examples.html @@ -2,60 +2,51 @@-
- |
-
- Boost.Regex-Examples- |
-
- |
-
+ |
+
+ Boost.Regex+Examples+ |
+
+ |
+
There are three demo applications that ship with this library, they all come with makefiles for Borland, Microsoft and gcc compilers, otherwise you will - have to create your own makefiles. -
-A regression test application that gives the matching/searching algorithms a full workout. The presence of this program is your guarantee that the library will behave as claimed - at least as far as those items tested are concerned - - if anyone spots anything that isn't being tested I'd be glad to hear about it. -
+ if anyone spots anything that isn't being tested I'd be glad to hear about it.Files: parse.cpp, - regress.cpp, tests.cpp. -
-A simple grep implementation, run with no command line options to find out its usage. Look at fileiter.cpp/fileiter.hpp and the mapfile class to see an example of a "smart" bidirectional iterator that - can be used with boost.regex or any other STL algorithm. -
+ can be used with boost.regex or any other STL algorithm.Files: jgrep.cpp, - main.cpp. -
-A simple interactive expression matching application, the results of all matches are timed, allowing the programmer to optimize their regular - expressions where performance is critical. -
-Files: regex_timer.cpp. -
+ expressions where performance is critical. +Files: regex_timer.cpp.
The snippets examples contain the code examples used in the documentation:
credit_card_example.cpp: @@ -68,8 +59,7 @@ regex_grep example 1: searches a cpp file for class definitions.
regex_grep_example_2.cpp: regex_grep example 2: searches a cpp file for class definitions, using a global - callback function. -
+ callback function.regex_grep_example_3.cpp: regex_grep example 2: searches a cpp file for class definitions, using a bound member function callback.
@@ -87,21 +77,23 @@regex_split_example_1.cpp: regex_split example: split a string into tokens.
regex_split_example_2.cpp - : regex_split example: spit out linked URL's. -
-
Revised - - 11 April 2003 - -
-© Copyright John Maddock 1998- 2003
-Permission to use, copy, modify, distribute and sell this software +11 +April 2003 +
+ +© Copyright John +Maddock 1998- +2003 +
+Permission to use, copy, modify, distribute and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. Dr John Maddock makes no representations about the suitability of this software - for any purpose. It is provided "as is" without express or implied warranty.
+ for any purpose. It is provided "as is" without express or implied warranty. diff --git a/doc/Attic/format_syntax.html b/doc/Attic/format_syntax.html index dc71d6d8..3aa628bb 100644 --- a/doc/Attic/format_syntax.html +++ b/doc/Attic/format_syntax.html @@ -28,7 +28,7 @@ regex_merge and by match_results::format, and are used to transform one string into another. -There are three kind of format string: sed, perl and extended, the extended +
There are three kind of format string: sed, Perl and extended, the extended syntax is a superset of the others so this is covered first.
Extended format syntax
@@ -49,7 +49,7 @@
Sub-expression expansions:
The following perl like expressions expand to a particular matched +
The following Perl like expressions expand to a particular matched
sub-expression:
@@ -158,7 +158,7 @@
Todo.
+Boost 1.31.0.
+
© Copyright John Maddock 1998- 2003
+© Copyright John Maddock 1998- 2003
Permission to use, copy, modify, distribute and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that diff --git a/doc/Attic/install.html b/doc/Attic/install.html index b816b2c8..5ed56831 100644 --- a/doc/Attic/install.html +++ b/doc/Attic/install.html @@ -134,9 +134,9 @@ directly to your project then define BOOST_REGEX_NO_LIB to disable automatic library selection.
Important: there have been some reports of
- compiler-optimisation bugs affecting this library, (particularly with VC6
+ compiler-optimization bugs affecting this library, (particularly with VC6
versions prior to service patch 5) the workaround is to build the library using
- /Oityb1 rather than /O2. That is to use all optimisation settings except /Oa.
+ /Oityb1 rather than /O2. That is to use all optimization settings except /Oa.
This problem is reported to affect some standard library code as well (in fact
I'm not sure if the problem is with the regex code or the underlying standard
library), so it's probably worthwhile applying this workaround in normal
diff --git a/doc/Attic/introduction.html b/doc/Attic/introduction.html
index ea0d588a..2f18e11a 100644
--- a/doc/Attic/introduction.html
+++ b/doc/Attic/introduction.html
@@ -26,16 +26,16 @@
Regular expressions are a form of pattern-matching that are often used in text
processing; many users will be familiar with the Unix utilities grep, sed
- and awk, and the programming language perl, each of which make
+ and awk, and the programming language Perl, each of which make
extensive use of regular expressions. Traditionally C++ users have been limited
to the POSIX C API's for manipulating regular expressions, and while regex++
does provide these API's, they do not represent the best way to use the
library. For example regex++ can cope with wide character strings, or search
- and replace operations (in a manner analogous to either sed or perl), something
+ and replace operations (in a manner analogous to either sed or Perl), something
that traditional C libraries can not do. The class boost::basic_regex is the key class in
this library; it represents a "machine readable" regular expression, and is
- very closely modelled on std::basic_string, think of it as a string plus the
+ very closely modeled on std::basic_string, think of it as a string plus the
actual state-machine required by the regular expression algorithms. Like
std::basic_string there are two typedefs that are almost always the means by
which this class is referenced:
(\d{4}[- ]){3}\d{4}
Here the parenthesis act to group (and mark for future reference) sub-expressions, and the {4} means "repeat exactly 4 times". This is an example - of the extended regular expression syntax used by perl, awk and egrep. Regex++ + of the extended regular expression syntax used by Perl, awk and egrep. Regex++ also supports the older "basic" syntax used by sed and grep, but this is generally less useful, unless you already have some basic regular expressions that you need to reuse.
-Now lets take that expression and place it in some C++ code to validate the +
Now let's take that expression and place it in some C++ code to validate the format of a credit card number:
bool validate_card_format(const std::string s) { @@ -83,13 +83,13 @@ examples assume that your compiler supports Koenig 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. -Those of you who are familiar with credit card processing, will have realised +
Those of you who are familiar with credit card processing, will have realized that while the format used above is suitable for human readable card numbers, it does not represent the format required by online credit card systems; these require the number as a string of 16 (or possibly 15) digits, without any intervening spaces. What we need is a means to convert easily between the two formats, and this is where search and replace comes in. Those who are familiar - with the utilities sed and perl will already be ahead here; we + with the utilities sed and Perl will already be ahead here; we need two strings - one a regular expression - the other a "format string" that provides a description of the text to replace the match with. In regex++ this search and replace operation is performed with the @@ -152,7 +152,7 @@ std::string human_readable_card_number(const std::string s) advanced features like multi-character collating elements and equivalence classes - as well as providing compatibility with other regular expression libraries including GNU and BSD4 regex packages, and to a more limited extent - perl 5. + Perl 5.
@@ -172,3 +172,4 @@ std::string human_readable_card_number(const std::string s)