in reply to Regex MATCH
If I understand your question, you want to match the line that has HYPHEN towards end of the lines. If so, the below script does that
Outputuse warnings; use strict; while ( defined( my $line = <DATA> ) ) { chomp $line; print $line, $/ if $line =~ m/\-[0-9a-z]{3}/; } __DATA__ DOC_001_123 DOC_002_214 DOC_001-548 DOC_001-987
UPDATE:DOC_001-548 DOC_001-987
in your script or you can get explanation of a regular expression using YAPE::Regex::Explainuse re 'debug';
|
|---|