标签: c++ regex visual-studio-2010 replace
如何将shared_ptr<\w+\>\(new_w<\w+\>\(\)\)等正则表达式替换为make_shared<$1>(),其中$1将成为\w+ {通常会将所有shared_ptr<T>(new_w<T>())替换为make_shared<T>())?
shared_ptr<\w+\>\(new_w<\w+\>\(\)\)
make_shared<$1>()
$1
\w+
shared_ptr<T>(new_w<T>())
make_shared<T>()
答案 0 :(得分:0)
添加捕获组:
shared_ptr<(\w+)\>\(new_w<\w+\>\(\)\)