关于
CppVerbalExpressions是麻省理工学院构建的 C++ 正则表达式库
项目地址 github.com
支持 c++11 std::regex 或者 boost::regex
使用
头文件
verbalexpressions.hpp
类及成员函数
Items
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| .anything()
.anything_but( const std::string & value )
.something()
.something_but(const std::string & value)
.end_of_line()
.find( const std::string & value )
.maybe( const std::string & value )
.start_of_line()
.then( const std::string & value )
|
Special characters and groups
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| .any( const std::string & value )
.any_of( const std::string & value )
.br()
.linebreak()
.range( const std::vector<std::pair<std::string, std::string>> & args )
.range( const std::std::string & a, const & std::string b )
.tab()
.word()
|
Modifiers
1 2 3 4 5 6
| .with_any_case()
.search_one_line()
.search_global()
|
Functions
1 2 3 4
| .replace( const std::string & source, const std::string & value )
.test( const std::string& value )
|
Other
1 2 3 4 5 6
| .add(value)
.multiple( const std::string & value )
.alt( const std::string& value )
|