1 #include <boost/cregex.hpp>
3 #include <luabind/luabind.hpp>
11 void wrap_regex(lua_State
* L
)
14 using namespace luabind
;
16 class_
<RegEx
>(L
, "regex")
17 .def(constructor
<const char*>())
18 .def(constructor
<const char*, bool>())
19 .def("match", (bool(RegEx::*)(const char*, unsigned int))&RegEx::Match
)
20 .def("search", (bool(RegEx::*)(const char*, unsigned int))&RegEx::Search
)
21 .def("what", &RegEx::What
)
22 .def("matched", &RegEx::Matched
)
23 .def("length", &RegEx::Length
)
24 .def("position", &RegEx::Position
)
27 value("match_default", boost::match_default
),
28 value("match_prev_avail", boost::match_prev_avail
),
29 value("match_not_bob", boost::match_not_bob
)
34 void test_wrap_regex()
36 lua_State
* L
= lua_open();
42 lua_dofile(L
, "regex.lua");