diff options
Diffstat (limited to '')
-rw-r--r-- | src/boost/tools/boost_install/test/regex/quick.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/boost/tools/boost_install/test/regex/quick.cpp b/src/boost/tools/boost_install/test/regex/quick.cpp new file mode 100644 index 000000000..f3421ea7c --- /dev/null +++ b/src/boost/tools/boost_install/test/regex/quick.cpp @@ -0,0 +1,21 @@ + +// Copyright 2018 Peter Dimov. +// +// Distributed under the Boost Software License, Version 1.0. +// +// See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt + +#include <boost/regex.hpp> +#include <boost/core/lightweight_test.hpp> + +int main() +{ + boost::regex rx( "(\\d+)-+(\\d+)-+(\\d+)" ); + + std::string s = boost::regex_replace( std::string( "+1--2--3+" ), rx, "$1$2$3" ); + + BOOST_TEST_EQ( s, "+123+" ); + + return boost::report_errors(); +} |