【问题标题】:Boost regexp how to parse Cookie string into map<string, string>?Boost 正则表达式如何将 Cookie 字符串解析为 map<string, string>?
【发布时间】:2011-10-10 23:09:40
【问题描述】:

所以 Cookie 字符串看起来像 remixsettings_bits=1; wysiwyg=1,2,3,abc; remixclosed_tabs=0; remixgroup_closed_tabs=786432; remixlang=0; remixchk=5; remixsid=35d4f9907281708019490d07728c27ca5c10e5de7a869c322222225e3219e; audio_vol=100 我想知道如何将 tham 解析为映射 name value

【问题讨论】:

    标签: c++ regex boost boost-regex


    【解决方案1】:

    试试这个正则表达式:(\w+)=([^;]*)

    1. \w+ - 字母数字一次或多次重复
    2. =
    3. [^;]* - 除; 之外的任何字符,任意重复次数

    结果:

    【讨论】:

    • 这只是问题的一方面。你没有说如何在 boost 中使用你的正则表达式。(
    • 因为我个人不知道如何使用 boost regexp=(
    • @Kabumbus,对不起,我不知道提升。在这部分问题上我帮不了你。我的道歉:-(
    猜你喜欢
    • 1970-01-01
    • 2014-03-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-02-14
    相关资源
    最近更新 更多