in reply to Generalising string in pattern

Based on how I interpret your request, I think this is what you want.
#!/usr/bin/perl use strict; my $pattern = qr/Latest \d+ Items in / . qr/Feed & \d New Fetched items/; while (<DATA>) { print if /$pattern/; } __DATA__ Latest 29 Items in Feed & 0 New Fetched items Testing Latest 28 Items in Feed & 0 New Fetched items Latest 100 Items Latest 28 Items in Feed & 0 New Fetched items

Replies are listed 'Best First'.
A reply falls below the community's threshold of quality. You may see it by logging in.