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]*?\的创始人。