【发布时间】:2009-06-22 07:55:05
【问题描述】:
我在 Perl 中有匹配正则表达式。 超过一行的匹配句子。
我意识到我必须在一行中输入匹配正则表达式,如果我传播 多行失败:
$array_11 =~ m{By Steve (.*), MarketWatch LONDON (.*) -- Shares of Anglo American rallied on Monday morning as (.*) bet that the mining group will reject a (.*)};'
如果我把它写成多行,它将无法匹配这个字符串。
【问题讨论】:
-
为什么要调用标量变量 $array_11?
-
你期望这个字符串“模式”有多少个独特的组合?
标签: regex perl code-formatting