$String = "hello I went to the store yesterday and the day after and the day after";
我只想打印单词i went to the store
。我尝试了两种方法,都没有奏效:
if ($String =~ /hello/i) {
until ($String =~ /yesterday/i) {
print "Summary: $'"
}
}
这打印了整个字符串。我使用了 $' 函数,但它占用了太多数据。我该如何限制它?
如果我只想打印“昨天和后天”怎么办?我怎样才能开始匹配中间的脚本?