Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/regex/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Regex 正则表达式与多行字符串不匹配_Regex_Typescript - Fatal编程技术网

Regex 正则表达式与多行字符串不匹配

Regex 正则表达式与多行字符串不匹配,regex,typescript,Regex,Typescript,例句是: "Thanks to this crisis, there has been a wake-up call to some of these neobanks," said Ali Niknam, CEO and founder of Dutch online bank Bunq. "To run a healthy business, you need healthy business conduct." 我的正则表达式是 (said)\s

例句是:

"Thanks to this crisis, there has been a wake-up call to some of these neobanks," said Ali Niknam, CEO and founder of Dutch online 
bank Bunq. "To run a healthy business, you need healthy business conduct."
我的正则表达式是

(said)\s.*,\s(CEO and founder of)\s.*\.
我希望它能和我的相配

said Ali Niknam, CEO and founder of Dutch online 
bank Bunq.
但这并不是因为“在线”一词后的“中断”。有没有一种方法可以使其在不修改示例文本的情况下工作?

请参见此处:

  • 不包括换行符。您可以改用
    (.|\n)
  • 默认情况下,
    *
    是贪婪的。使用
    *?
    使其不贪婪,即在匹配下一个表达式之前,它匹配最小数量的文本(在本例中-
    \.

  • 对不起,这是不对的。我的问题不同。在我的情况下,它与任何内容都不匹配。那么您的帖子中的输入文本可能不正确。请检查。请现在看。检查编辑的句子。所以不知何故,你可以这样吃:
    said\s[\s\s]*?,\sCEO和\s[\s\s]*?\的创始人。