in reply to Matching all text after a specific character

How about this?

#! perl use strict; use warnings; my $s = 'XYX_WT_7_25h_Trimmed_75.SAM'; print $1 if $s =~ / ( _ [^_]+ _ [^_]+ ) $ /x;

Output:

23:31 >perl 1687_SoPW.pl _Trimmed_75.SAM 23:32 >

Hope that helps,

Athanasius <°(((><contra mundum Iustus alius egestas vitae, eros Piratica,