正規表現道場@2ch
■ このスレッドは過去ログ倉庫に格納されています
0369nobodyさん
02/06/24 03:39ID:???Perlでド適当に書くとこんな感じ.
my ($href, $title);
while ($str =~ m{<a\s+(?:href\s*=\s*(["'])(.+?)\1|.)+?>(.+?)</a>}gis) {
($href, $title) = ($2, $3);
$href or next;
print "href: $href\ntitle: $3\n\n";
}
■ このスレッドは過去ログ倉庫に格納されています