douce1368
2016-02-20 15:13 阅读 67
已采纳

在posix regex c ++中等于pcre正则表达式

Hello this is my string

Data1 = "value1";
Data2 = "value2";
Data3 = "value3";

in php i am using this regex

preg_match("/\h*(.*?)\h*[=]\h*[\"](.*?)[\"]\h*[;]/mis", $input_line, $output_array);

and get 3 result

Data1 = "value1";
Data1
Value1
...
...

now i want to use regex in c++ visual studio to do like this (what i done in php). i know we can't find

\h*

in c++ regex so please say to me what regex i must use for c++?

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

1条回答 默认 最新

  • 已采纳
    duan051347 duan051347 2016-02-20 15:30

    \h matches horizontal whitespace.
    It includes tabulations and unicode spaces. It's the same as [\t\p{Zs}]

    If you don't want to match all unicode spaces, you can simply use [\t ] that matches tabulations and simple spaces.

    点赞 评论 复制链接分享

相关推荐