提升正则表达式如何将Cookie字符串解析为map <string,string =“”>?</string,>

时间:2011-07-22 10:55:25

标签: c++ regex boost boost-regex

所以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到map name&lt; - &gt; value

1 个答案:

答案 0 :(得分:3)

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

  1. \w+ - 字母数字一次或多次重复
  2. =
  3. [^;]* - 除;任意数量的重复之外的任何字符
  4. 结果: enter image description here

相关问题