in reply to Dictionary filter regex

When all you have is a hammer...
my @words = qw( clash school schools hosepipes crystallography ); print $_, "\n" for grep { tr/sh//cdr eq "sh" } @words;

Replies are listed 'Best First'.
Re^2: Dictionary filter regex
by Anonymous Monk on Nov 26, 2016 at 21:45 UTC
    p.s. looks like others decided that it should be case insensitive, you can use lc or fc for that
    { fc =~ tr/sh//cdr eq "sh" }