Removing trailing asterisk from lines with regexby Tmms (Initiate)
|on Apr 14, 2017 at 20:35 UTC||Need Help??|
Tmms has asked for the
wisdom of the Perl Monks concerning the following question:
I have a text file and some of the lines contain a trailing asterisk (they are protein sequences and * stands for a stop codon). I was trying to write a short perl script to remove (substitute with empty string) them, but I got some results I found weird. Hopefully someone could help me.
I tried this code, but it does not work. The * are still there.
When I tried this code, it suddenly worked.
I think the previous code worked because every line contains a newline character (\n). But when I replace \s with \n the code stopped working. That made me confused and made me wonder these three things:
Thanks in advance.