my $pat = qr/id\d+/; while (<>) { print if /$pat/; }