
BillKSmith
Veteran
Dec 5, 2012, 7:54 PM
Post #2 of 3
(2262 views)
|
Re: [shinyhui] regular expression
[In reply to]
|
Can't Post
|
|
use strict; use warnings; my @files = ( 'ABC1.txt', 'ABC1a_1.txt', 'ABC1a_1_1.txt', 'ABC1b.txt', 'ABC1b_1.txt', 'ABC11.txt', 'ABC1.png', ); my @special_files = grep {/ABC1(:?a_1|a_1_1|b|b_1)?\.txt/} @files; print "@special_files\n"; Good Luck, Bill
|