]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/regex/performance/xpressive.cpp
1 ///////////////////////////////////////////////////////////////
2 // Copyright 2015 John Maddock. Distributed under the Boost
3 // Software License, Version 1.0. (See accompanying file
4 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_
7 #include <boost/config.hpp>
9 #include "performance.hpp"
10 #include <boost/xpressive/xpressive.hpp>
12 using namespace boost::xpressive
;
14 struct xpressive_regex
: public abstract_regex
20 virtual bool set_expression(const char* pe
, bool isperl
)
26 e
= cregex::compile(pe
, regex_constants::ECMAScript
);
28 catch(const std::exception
&)
34 virtual bool match_test(const char* text
);
35 virtual unsigned find_all(const char* text
);
36 virtual std::string
name();
42 xpressive_regex::register_instance(boost::shared_ptr
<abstract_regex
>(new xpressive_regex
));
44 void do_nothing()const {}
46 static const initializer init
;
49 const xpressive_regex::initializer
xpressive_regex::init
;
52 bool xpressive_regex::match_test(const char * text
)
54 return regex_match(text
, what
, e
);
57 unsigned xpressive_regex::find_all(const char * text
)
59 cregex_token_iterator
i(text
, text
+ std::strlen(text
), e
), j
;
69 std::string
xpressive_regex::name()
72 return "boost::xpressive::cregex";