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

Equal of pcre regex in posix regex c++

本文关键字:正则表达式 pcre 中的 c++ 等于 posix      更新时间:2023-10-16

你好,这是我的字符串

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

在 PHP 中,我正在使用这个正则表达式

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

并获得 3 个结果

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

现在我想在C ++ Visual Studio中使用正则表达式来做这件事(我在PHP中所做的)。 我知道我们找不到

h*
在 C++ 正则

表达式中,请告诉我我必须为 C++ 使用什么正则表达式?

h匹配水平空格。
它包括表格和 unicode 空格。它和[tp{Zs}]一样

如果您不想匹配所有 unicode 空格,只需使用匹配表格和简单空格的[t ]即可。