boost::regex Character set including braces
Dear boost-users,
in the post
http://stackoverflow.com/questions/20351369/regular-expression-cant-find-seq
uence-of-numbers
I discovered that if one uses an closing bracket as the first character of a
character class the character class includes this bracket.
This works with the standard setting of boost::regex (i.e., perl-regular
expressions) but it is not documented in the
manual page
http://www.boost.org/doc/libs/1_55_0/libs/regex/doc/html/boost_regex/syntax/
perl_syntax.html#boost_regex.syntax.perl_syntax.character_sets
Is this an undocumented feature, a bug or did I misinterpret something in
the manual?
The version information in version.hpp is:
#define BOOST_LIB_VERSION "1_53"
Info: I tried this specification of the bracket in the character set because
I am used to it from emacs regular expressions.
In the remainder there follows a program for reproduction of the phenomenon:
#include <string>
#include
I discovered that if one uses an closing bracket as the first character of a character class the character class includes this bracket. This works with the standard setting of boost::regex (i.e., perl-regular expressions) but it is not documented in the manual page
http://www.boost.org/doc/libs/1_55_0/libs/regex/doc/html/boost_regex/syntax/ perl_syntax.html#boost_regex.syntax.perl_syntax.character_sets
Is this an undocumented feature, a bug or did I misinterpret something in the manual?
It's a feature, both Perl and POSIX extended regular expression behave the same way. John.
participants (2)
-
John Maddock
-
Tobias