1 #include <boost/cregex.hpp>
10 #include <luabind/luabind.hpp>
14 bool match(boost::RegEx
& r
, const char* s
)
19 bool search(boost::RegEx
& r
, const char* s
)
23 } // namespace unnamed
26 void wrap_regex(lua_State
* L
)
29 using namespace luabind
;
33 class_
<RegEx
>("regex")
34 .def(constructor
<const char*>())
35 .def(constructor
<const char*, bool>())
37 .def("search", search
)
38 .def("what", &RegEx::What
)
39 .def("matched", &RegEx::Matched
)
40 .def("length", &RegEx::Length
)
41 .def("position", &RegEx::Position
)
47 lua_State
* L
= lua_open();
54 lua_dofile(L
, "regex.lua");