回复:[PerlChina] perlchina@googlegroups.com 的摘要 - “1 个主题”有 2 个帖子

2 views
Skip to first unread message

陈钢

unread,
May 14, 2012, 5:02:31 AM5/14/12
to perl...@googlegroups.com
my @js_files = $html =~ /<script>balabala(.*?\.js)<\/script>/gims;
my $new_tag = "<script>";
foreach (@js_files)
{
    $new_tag.= $_ .",";
}
$new_tag .= "</script>";


在 2012-05-14 16:03:39,perl...@googlegroups.com 写道:

网上论坛: http://groups.google.com/group/perlchina/topics

    Cloud Liu <cloud...@gmail.com> May 14 11:47AM +0800  

    是否可以自己写个正则,把JS标签里的东西都合并在一起呢?
     
    在 2012年5月12日 下午10:22,蓝天下云层上 <imx36...@gmail.com>写道:
     

     

    Rui Hu <rui...@gmail.com> May 14 02:41PM +0800  

    楼主要的是处理html标签的,不是处理js内容的。楼上各位好像都是在猜测楼主意图
    其实楼主只是想处理连续三行相同标签的情况。
     
    我是新手 也期待高手给一个好的解决方法 正则只会简单匹配 这种处理没做过
     

     

您收到此邮件是因为您订阅了 Google 网上论坛 perlchina。
您可以通过电子邮件发帖
要取消订阅此网上论坛,请发送一封空邮件。
有关更多选项,请访问此网上论坛。

--
您收到此邮件是因为您订阅了 Google 网上论坛的“PerlChina Mongers 讨论组”论坛。
要向此网上论坛发帖,请发送电子邮件至 perl...@googlegroups.com
要取消订阅此网上论坛,请发送电子邮件至 perlchina+unsub...@googlegroups.com
若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。


Rui Hu

unread,
May 14, 2012, 5:21:44 AM5/14/12
to perl...@googlegroups.com
这个似乎没有达到楼主想要的连续的效果,楼主说是处理连续的三行
楼主给的示例中的d.js并没有被合并 你这个代码是不是会合并d.js到上面的三行中?


2012/5/14 陈钢 <missingy...@163.com>:

Fayland Lam

unread,
May 14, 2012, 5:31:04 AM5/14/12
to perl...@googlegroups.com
I know HTML::TreeBuilder with ->right() and ->right()->right()->{_tag}
eq 'script' can check if there is 3 scripts together, but it's pretty
tricky too.

Thanks

2012/5/14 Rui Hu <rui...@gmail.com>:

> --
> 您收到此邮件是因为您订阅了 Google 网上论坛的“PerlChina Mongers 讨论组”论坛。
> 要向此网上论坛发帖,请发送电子邮件至 perl...@googlegroups.com

> 要取消订阅此网上论坛,请发送电子邮件至 perlchina+...@googlegroups.com


> 若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。
>

--
Fayland Lam // http://www.fayland.org/

imxae

unread,
May 14, 2012, 8:53:11 AM5/14/12
to perl...@googlegroups.com

用HTML::TreeBuilder模块,笨重啊

Morya Feng

unread,
May 16, 2012, 10:09:04 AM5/16/12
to perl...@googlegroups.com
回复摘要文件很不好理解啊
还好这封只有两条信
上次看到一个兄弟回一个20几个汇总的信……
无语

在 2012年5月14日 下午8:53,imxae <imx36...@gmail.com>写道:

用HTML::TreeBuilder模块,笨重啊

Roger

unread,
May 18, 2012, 10:08:14 AM5/18/12
to perl...@googlegroups.com

perl...@googlegroups.com wrote:

>=============================================================================
>今日主题摘要
>=============================================================================
>
>网上论坛: perl...@googlegroups.com
>网址: http://groups.google.com/group/perlchina/topics
>
> - more than one way in perl [2 条更新]
> http://groups.google.com/group/perlchina/t/492494e7f83142e9
>
>
>=============================================================================
>主题: more than one way in perl
>网址: http://groups.google.com/group/perlchina/t/492494e7f83142e9
>=============================================================================
>
>---------- 第 1 个(共 2 个) ----------
>发件人: Haiyan Lin <linh...@gmail.com>
>日期: May 17 05:05PM +0800
>网址: http://groups.google.com/group/perlchina/msg/e3da78387de45080
>
>Hi, perlers,
>
>Supposing I have a hash reference in hand, the effect of the following
>two statements
>
>$hash1_ref = &subroutine1( $hash0_ref, 'parameter1' );
>$hash2_ref = &subroutine1( $hash1_ref, 'parameter2' );
>
>will save elements in $hash0_ref, stafisfying both parameter1 and
>parameter2, into $hash2_ref.
>
>I try to do this by following one statement, but I failed.
>
>$hash_ref2 = &subroutine1( &subroutine1( $hash0_ref, 'parameter1'),
>'paratemter2') ;
>
>any help? THANKS in advance
>
>==================================================
>?????????$hash0_ref?????parameter1 ?parameter2???,???$hash2_ref??
>$hash1_ref = &subroutine1( $hash0_ref, 'parameter1' );
>$hash2_ref = &subroutine1( $hash1_ref, 'parameter2' );
>
>
>????????,???,?????????,??????????????
>
>$hash_ref2 = &subroutine1( &subroutine1( $hash0_ref, 'parameter1'),
>'paratemter2') ;
>
>
>
>
>Haiyan Lin
>
>
>---------- 第 2 个(共 2 个) ----------
>发件人: joe jiang <lamp...@gmail.com>
>日期: May 17 07:41PM +0800
>网址: http://groups.google.com/group/perlchina/msg/11865bfc42817023
>
>Think this is related to your logic inside the subroutine1, please check
>why there are many lines of eval and 1>1

Reply all
Reply to author
Forward
0 new messages