boost regex正则区配 IP 地址
来源:互联网 发布:闲鱼怎样申请淘宝介入 编辑:程序博客网 时间:2024/06/02 02:10
#include <boost/regex.hpp>#include <iostream>#include <string>int main(){ std::string text(" 192.168.0.1 abc 10.0.0.255 10.5.1 1.2.3.4a 5.4.3.2 "); const char* pattern = "\\b(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)" "\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)" "\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)" "\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\b"; boost::regex ip_regex(pattern); boost::sregex_iterator it(text.begin(), text.end(), ip_regex); boost::sregex_iterator end; for (; it != end; ++it) { std::cout << it->str() << "\n"; // v.push_back(it->str()); or something similar }}
0 0
- boost regex正则区配 IP 地址
- boost regex正则区配 IP 地址
- 正则表达式 boost Regex
- boost - regex 正则表达式
- 正则表达式 boost Regex
- boost regex c++正则表达式
- boost库 -- regex正则表达式
- Boost::regex之正则表达式
- Boost.Regex库 正则表达式
- 9.Boost之正则regex
- [boost] regex c++正则表达式
- boost正则式解析MAC地址和IP地址
- boost正则式解析MAC地址和IP地址
- boost用正则表达式验证ip地址合法
- vs 2008 BOOST 正则IP地址与域名
- Boost 正则表达式库regex使用手记
- Boost学习之正则表达式--regex
- Boost学习之正则表达式--regex
- 看书杂记
- 高性能服务器设计
- oracle中的主键自动增长
- 网站设计的好坏对宣传的效果的影响!
- SAP 本地文件上传到内表 sap gui 安全性弹出框 解决方法
- boost regex正则区配 IP 地址
- 過濾器~~
- 高级系统架构师
- JQuery Tree插件——zTree v3.5.16 版 发布
- RSA加密解密JAVA实现
- runat=”server”
- Filter过滤器配置
- Silverlight实例教程 - Out of Browser配置,安装和卸载
- 新版openssl与erlang crypto模块冲突的解决办法