$ perl -le 'print for a .. z' | perl -nle 'if (/d/ .. /h/) { next unless //; print }' d f g h