Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Problem with regular expression

by Utilitarian (Vicar)
on Feb 12, 2013 at 16:01 UTC ( #1018403=note: print w/ replies, xml ) Need Help??


in reply to Problem with regular expression

Your criteria are a little under specified, however the following works, for what you've asked.

#!/usr/bin./perl use strict; use warnings; my @in=("TFS100","TFS 100","TFS-CR100", "TFS-CR 100","TFS_100","TFS ID 100", "TFS CR 100","TFS ID100","TFS-ID 100", "TFS ID:100","TFS-ID: 100", "- TFS CR634: STRESS: H 17326,21600,", "CR0080588","TFS0080588" ); for (@in){ print "$1\n" if /TFS[-_\s]?(?:CR|ID)?\s?([1-9]\d+)/; }
print "Good ",qw(night morning afternoon evening)[(localtime)[2]/6]," fellow monks."


Comment on Re: Problem with regular expression
Select or Download Code
Re^2: Problem with regular expression
by AnomalousMonk (Abbot) on Feb 12, 2013 at 17:18 UTC
    Your criteria are a little under specified...

    Amen to that, brother!

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2015-07-05 07:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (60 votes), past polls