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 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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 r语言蛋白组学相关问题
  • ¥15 Python时间序列如何拟合疏系数模型
  • ¥15 求学软件的前人们指明方向🥺
  • ¥50 如何增强飞上天的树莓派的热点信号强度,以使得笔记本可以在地面实现远程桌面连接
  • ¥20 双层网络上信息-疾病传播
  • ¥50 paddlepaddle pinn
  • ¥20 idea运行测试代码报错问题
  • ¥15 网络监控:网络故障告警通知
  • ¥15 django项目运行报编码错误
  • ¥15 STM32驱动继电器