/<img src="(.*?)"/m
===
我想应该是捕获网页的图片
<img src="
这样开始的行,但不明白后面的"(.*?)"/m
这个正则表如何理解?
- hackem
- 帖子: 258
- 注册时间: 2006-10-19 21:42
- 来自: inside
- 联系:
这个正则表如何理解?
ubuntu是个好东西
-
- 帖子: 262
- 注册时间: 2007-03-29 12:59
- 5451vs5451
- 帖子: 345
- 注册时间: 2006-07-14 18:56
- 来自: Apple Valley, Planet Tux, Linux System
代码: 全选
$ perldoc perlre
......
By default, a quantified subpattern is "greedy", that is, it will match as many times as possible (given a partic‐
ular starting location) while still allowing the rest of the pattern to match. If you want it to match the mini‐
mum number of times possible, follow the quantifier with a "?". Note that the meanings don’t change, just the
"greediness":
*? Match 0 or more times
+? Match 1 or more times
?? Match 0 or 1 time
{n}? Match exactly n times
{n,}? Match at least n times
{n,m}? Match at least n but not more than m times
......