in reply to extract sequences of certain letters and assign it to a variable

Homework?

Anyway, the shortest command in Perl that'll do what you ask for, is:

tr/zvxg//cd
which does an inplace replacement, deleting all characters that are not one of those four.
  • Comment on Re: extract sequences of certain letters and assign it to a variable
  • Download Code