且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

PCRECPP(pcre)从url代码中提取主机名问题

更新时间:2023-02-19 11:35:04

是你的代码包含 ??(这是C ++中的 [三字母或做某事来打破它们:

The problem is that your code contains ??( which is a trigraph in C++ for [. You'll either need to disable trigraphs or do something to break them up like:

pcrecpp::RE re("^((\\w+):\\/\\/\\/?)?((\\w+):?(\\w+)?@)?([^\\/\\?:]+):?(\\d+)?(\\/?[^\\?#;\\|]+)?([;\\|])?([^\\?#]+)?\\??" "([^#]+)?#?(\\w*)");