Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Problem with regular expression

by MARVion (Novice)
on Feb 13, 2013 at 09:38 UTC ( #1018510=note: print w/ replies, xml ) Need Help??


in reply to Problem with regular expression

Hi again,

well, with a litte change Utilitarian's Code works perfectly for me.

TFS[-_\s]?(?:CR|ID)?:?\s?([1-9]\d+)


However, I would appreciate it, if you could explain this section to me, as I'm not that familiar with regular expressions but for sure I want to learn to use them!

(?:CR|ID)?

Greetz

MARV


Comment on Re: Problem with regular expression
Select or Download Code
Replies are listed 'Best First'.
Re^2: Problem with regular expression
by Utilitarian (Vicar) on Feb 13, 2013 at 13:24 UTC
    oops, I missed the one with a colon :(
    (?: # begin non capturing group CR|ID # alternation accepts either pattern group 'CR' or 'ID' )? # group is optional

    print "Good ",qw(night morning afternoon evening)[(localtime)[2]/6]," fellow monks."

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (7)
As of 2015-07-30 11:41 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 (271 votes), past polls