Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

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?

Replies are listed 'Best First'.
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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://955234]
[marioroy]: Hello all. After several attempts, am able to move forward and will soon release a Parallel:: ForkManager compatible MCE::Hobo:: Manager, also MCE::Hobo::Simple, and refactored MCE::Hobo engine supporting multiple instances. Wait works beautifully.
[marioroy]: MCE::Shared has been refined that it allows sharing Tie::File and hash objects containing {fh} key.
[marioroy]: It's taken so long to take Hobo to a new level. Threads-like and Parallel:: ForkManager management capaiblities.
[marioroy]: This will complete the 4 years in the making and likely time to move on to something els.
[marioroy]: s/els/else.

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (7)
As of 2017-05-26 08:26 GMT
Find Nodes?
    Voting Booth?