good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Re: Replace characters within stringby Anonymous Monk |
on Sep 07, 2022 at 23:42 UTC ( [id://11146759]=note: print w/replies, xml ) | Need Help?? |
Stuff like [I|O|P|B|M] doesn't do what you think it does. In character classes (the square brackets) the pipe character is a literal pipe character, not an operator. So you should write [IOPBM]. See "Special Characters Inside a Bracketed Character Class" in perlrecharclass for details. Yet another proof that Guido was right. Are these characters amino acids or something? It's a good thing that Perl is still used by geneticists, otherwise we would've already been exterminated by engineered diseases.
In Section
Seekers of Perl Wisdom
|
|