Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^2: Help required on understanding regular expressions

by bimleshsharma (Beadle)
on Feb 21, 2012 at 06:37 UTC ( #955234=note: print w/ replies, xml ) Need Help??


in reply to Re: Help required on understanding regular expressions
in thread Help required on understanding regular expressions

I dont understand the code.. /(?<fname>\w+\b)\s(?<mname>\w+)\s(?<lname>\w+\s).*\[(?<date>[^\]]+)/ what it is looking for from string?


Comment on Re^2: Help required on understanding regular expressions
Download Code
Re^3: Help required on understanding regular expressions
by NetWallah (Abbot) on Feb 21, 2012 at 16:35 UTC
    /(?<fname>\w+\b) # Looks for "\w" (Word characters followed by a word +boundary (look up \w and \b) # and creates $+{name} \s(?<mname>\w+)\s # Same thing - Whitespace on both sides (?<lname>\w+\s) # Same thing .*\[(?<date>[^\]]+)/ # looks for "[", followed by anything that is NOT + "]", and populates $+{date}
    All this is in the "perlre" document.

                “PHP is a minor evil perpetrated and created by incompetent amateurs, whereas Perl is a great and insidious evil perpetrated by skilled but perverted professionals.”
            ― Jon Ribbens

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (6)
As of 2014-11-29 01:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (203 votes), past polls