Last active
January 25, 2018 05:12
-
-
Save ryu1-1uyr/430a6c29000a8f0300c3439bfb12ca82 to your computer and use it in GitHub Desktop.
perlでHTMLのタグを抜きます
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/use/bin/perl | |
use warnings; | |
use strict; | |
use 5.010; | |
my $line; | |
while($line = <>){ | |
if($line =~ /<.*?>/){ | |
$line =~ s/<.*?>//g; | |
print"$line"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Perlなら下記おなじコード
while (<>) { if (/<.*?>/) { s/<.*?>//g; print; } }