Skip to content

Instantly share code, notes, and snippets.

@ryu1-1uyr
Last active January 25, 2018 05:12
Show Gist options
  • Save ryu1-1uyr/430a6c29000a8f0300c3439bfb12ca82 to your computer and use it in GitHub Desktop.
Save ryu1-1uyr/430a6c29000a8f0300c3439bfb12ca82 to your computer and use it in GitHub Desktop.
perlでHTMLのタグを抜きます
#!/use/bin/perl
use warnings;
use strict;
use 5.010;
my $line;
while($line = <>){
if($line =~ /<.*?>/){
$line =~ s/<.*?>//g;
print"$line";
}
}
@omas-public
Copy link

omas-public commented Jan 25, 2018

Perlなら下記おなじコード
while (<>) { if (/<.*?>/) { s/<.*?>//g; print; } }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment