I am extracting line by line from a file and splitting into words.
I want all the words except the words enclosed between ‘<‘ and ‘>’.
if($word =~ m/^(\<).*(\>)$/)
{
print "Remove this word";
}
I tried the above code.But its not working.
This is the file I’m processing :
#> main bcel_coverage.A
#> <init> bcel_coverage.C
<# <init>
?? main
abc
<# main
I do not want <init> in the above file to be printed. Anything else can also be enclosed within ‘<‘ and ‘>’.
Split the line with a regex that matches words enclosed inside
<...>.Regex: