in reply to Find part of string

Assuming that you have the strings in an array and want the strings that match "_theWord" to be placed in another array, this should work.

use strict; use warnings; my @strings = qw{ ac_dajhta_theWord sd_dfdfe_fdfdv ca_hereeds_theWord se_dcvdfdef_dsfd cx_hserj_theWord fa_dferefvdvv_fadfde}; my @matchingStrings = grep m{_theWord}, @strings; print qq{$_\n} for @matchingStrings;

The output is

ac_dajhta_theWord ca_hereeds_theWord cx_hserj_theWord

I hope this is of use.

Cheers,

JohnGG

Update: corrected wonky <code> tag