Regex \w escaping in C++11

后端 未结 2 755
情歌与酒
情歌与酒 2021-01-15 17:04

This code isn\'t returning anything, am I escaping the w character the wrong way??

http://liveworkspace.org/code/3bRWOJ$38

#include 
         


        
2条回答
  •  走了就别回头了
    2021-01-15 17:44

    The regular expression should contain \w, consisting of two characters, \ and w, hence your C++ source code should contain "\\w" as you need to escape the backslash.

提交回复
热议问题