Files

25 lines
644 B
C++
Raw Permalink Normal View History

2026-07-14 23:20:12 +08:00
#include <iostream>
#include <boost/regex.hpp>
#include ".\message\message.h"
using namespace std;
using namespace boost;
extern const string MESSAGE;
int main()
{
string s = R"(Search Engines: http://baidu.com https://google.com About Me: https://xuhongxu.com/about/)";
regex e("(([a-zA-Z]*)://\\[a-zA-Z0-9\\_-\\]+(\\.\\[a-zA-Z0-9\\_-\\]+)+(/\\[^\\s<>\"\\)\\]\\*)?");
for (sregex_iterator m(s.begin(), s.end(), e), end; m != end; ++m)
{
cout << "URL: " << (*m)[0].str() << endl;
cout << "Scheme: " << (*m)[1].str() << endl;
cout << endl;
}
cout << "结束" << endl;
return 0;
}