您当前的位置: 首页 >  c++

qianbo_insist

暂无认证

  • 0浏览

    0关注

    399博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

c++ 使用正则匹配url

qianbo_insist 发布时间:2021-06-10 20:50:10 ,浏览量:0

stl regex

     stl 中regex 非常好用,即使不用boost库也可以很轻易地且高效地摘取你想要的内容,这里提供一个class 解析出 a href 的文件名路径和文件名和文件后缀名     另外需要解析url的朋友可以看这篇文章: 解析url的代码

代码 show me the code
/*

 author:qianbo
 date  :2014-11-06
 功能  :解析html A href 取出其中的连接,解析出全路径 文件前缀 文件后缀
*/

#include     
#include     
#include   
#include 
#include 
#include 
using namespace std;

typedef struct dataHtmlFile 
{
	string s1;         //全路径
	string filePrefix; //文件前缀 
	string fileSuffix; //带dot的文件后缀 如 .png .jpg 
}dataHtmlFile;


template 
class PrintString
{
public:
	PrintString()
	{
	}
	void operator ( ) ( Type& elem ) const
	{
		cout            
关注
打赏
1663161521
查看更多评论
0.0384s