[PerlChina] perl 正则表达式

张晓亮 alaboszhang at gmail.com
Fri Jul 4 19:58:10 PDT 2008


各位:

    有类似如下字符串:
    Book/LN/16.aspx古典仙侠

    
    用: 
    print $1 if $str =~/\/Book\/LN\/(\d+).aspx/;

    这样可以得到  16


    用:
    print $1,$2 if $str =~/\/Book\/LN\/(\d+).aspx(.*)/;

    这样不能得到 $2
    
   请问这个正则该如何修改?



aj



    
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/china-pm/attachments/20080705/911d411d/attachment.html>


More information about the China-pm mailing list