use strict; use warnings; my $user_input = "abc"; my $regex = qr/${user_input}_ABC_.*pd/; foreach my $file (qw (abc abc_ABC_something.pdf abc_ABC_anything.pdf +)) { next unless $file =~ /$regex/; print "$file is valid\n"; } __END__ abc_ABC_something.pdf is valid abc_ABC_anything.pdf is valid
In reply to Re: searching files
by Marshall
in thread searching files
by michael99
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |