redis01:/root# cat x2.pl
my $str="a19823a456123";
if ($str =~/a(.*)23/){print "1----".$1."\n";};
if ($str =~/a(.*?)23/){print "2----".$1."\n";};
redis01:/root# perl x2.pl
1----19823a4561
2----198
perl 贪婪匹配小例子
转载本文章为转载内容,我们尊重原作者对文章享有的著作权。如有内容错误或侵权问题,欢迎原作者联系我们进行内容更正或删除文章。
上一篇:perl .*?和.*
下一篇:Mongdb 访问
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
python协程(asyncio)实现爬虫例子
使用python协程实现异步爬取网站。
python 协程 爬虫 -
python re 非贪婪匹配 vim 非贪婪匹配
正则 - vim - 使用 非贪婪模式 匹配字符串
python re 非贪婪匹配 正则 vim sed