[Tokyo.pm] Perl5.6 での正規表現

simon.p.cozens @ jp.pwcglobal.com simon.p.cozens @ jp.pwcglobal.com
2000年 4月 12日 (水) 00:30:23 CDT

-------------- next part --------------

> 5.6¤Ç¶¯²½¤µ¤ì¤¿Àµµ¬É½¸½¤ÎǽÎϤȤ·¤Æ¡¢Àµµ¬É½¸½¤ÎÃæ¤Ë
> Perl¤Î¥³¡¼¥É¤òËä¤á¹þ¤á¤ë¤«¤éXML¤Ç»È¤ï¤ì¤Æ¤¤¤ë¤è¤¦¤Ê
> Âбþ¤¹¤ë¥¿¥°¤ÎÂФ˥ޥåÁ¤¹¤ëÀµµ¬É½¸½¤ò½ñ¤±¤ë

> ¤È¤¤¤¦¤Î¤¬¤¢¤Ã¤¿¤È»×¤¦¤ó¤Ç¤¹¤¬¡¢¤³¤ì¤ÎÎã¤Ï¤É¤³¤«¤Ë
> ¤¢¤ë¤Ç¤·¤ç¤¦¤«¡©


use re "eval";
sub p {my $b=1;$_=shift; my $a; s/\n//sg; my $op = qr/<([^>]+?)\s*[^>]*>/;
{"\nOPEN (".($a=$1).")\n".p($2)."\nCLOSE ($a)\n"}seg;return $_;}

print p(<<EOF);
    <head> Foo </head>
        <thing widget=blah> bar </thing>

The information transmitted is intended only for the person or entity to
which it is addressed and may contain confidential and/or privileged
material.  Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by persons or
entities other than the intended recipient is prohibited.   If you received
 this in error, please contact the sender and delete the material from any

Tokyo-pm メーリングリストの案内