Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Generalising string in pattern

by bichonfrise74 (Vicar)
on Nov 13, 2009 at 08:49 UTC ( [id://806899]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://806899]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (2)
As of 2024-04-26 03:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found