2009/10/25 Yingying <[email protected]>: > 谢谢! > > 我以前没学过perl,现在用到它写匹配的小程序发现到网上各处查的资料真是太散了,我是得系统地学习下perl。 >
Learning Perl 中说那书的20%的内容可以满足你80%的日常需求。:-) > On 10月24日, 下午5时55分, Michael Zeng <[email protected]> wrote: >> \Q${str}\E 是强引用,即quotemeta $str >> >> 把[^0-9a-zA-Z_]的东西都加 \ , perldoc -f quotemeta >> >> .*? 是非贪婪匹配, 你把Learning Perl 好好看看,这些都是基础知识 >> >> 2009/10/25 Yingying <[email protected]>ot >> >> >> >> >> >> > 请问Xiaojun Deng为什么你写的src中用的是.*?,这里的"?"是什么意思呢? >> >> > On 10月23日, 下午7时25分, Xiaojun Deng <[email protected]> wrote: >> > > 2009/10/23 Yingying <[email protected]>:> 如果我还想再从这段源码中找到一个图像地址<img >> > src="XXXXXXXX">,我应该怎么把这个图像地址提取出来呢? >> >> > > \<img\ src\="(.*?)"\> >> > > 再把()中的提取到一个变量中就可以了,比如$1 $2啥的。 >> >> > > > 谢谢!! >> >> > > > On 10月23日, 上午12时37分, Yingying <[email protected]> wrote: >> > > >> 我在$_中存了一个相当长的字符串(一页网页的源代码),现在我想从中匹配一段代码,比如/<div\sclass="user-thumb- >> >> > xlarge"><div>\s+<a\shref=.+\s+<img.*>\s*<\/a>/,有办法把这段匹配的网页源代码另外存在一个字符串里 >> > > >> 吗?我到网上查了很多地方,都没有说的样子... >> >> -- >> Yours Sincerely >> Zeng Hong > > > --~--~---------~--~----~------------~-------~--~----~ 您收到此信息是由于您订阅了 Google 论坛“PerlChina Mongers 讨论组”论坛。 要在此论坛发帖,请发电子邮件到 [email protected] 要退订此论坛,请发邮件至 [email protected] 更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛 -~----------~----~----~----~------~----~------~--~---
