Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^4: regex: extract multiple number of date patterns from certain lines

by Random_Walk (Parson)
on Mar 05, 2009 at 06:34 UTC ( #748418=note: print w/ replies, xml ) Need Help??


in reply to Re^3: regex: extract multiple number of date patterns from certain lines
in thread regex: extract multiple number of date patterns from certain lines

Hi Marshall

There is actually a constraint that it has to be a single regex, see my answer to Ikegami at Re^2: regex: extract multiple number of date patterns from certain lines to see more of the context in which I am operating.

As for XP, I did not vote you down but there are some grumpy monks around with itchy trigger fingers, I got -- for every single reply in this thread. Don't worry about it too much, sometimes you get a little hit but is normally tends upwards.

Cheers,
R.

Pereant, qui ante nos nostra dixerunt!


Comment on Re^4: regex: extract multiple number of date patterns from certain lines
Re^5: regex: extract multiple number of date patterns from certain lines
by Marshall (Prior) on Mar 06, 2009 at 20:34 UTC
    Hi, I am trying to be helpful, not just argumentative just for the sake of arguing. I looked at this:
    http://search.cpan.org/~rcaputo/POE-1.003/lib/POE/Wheel/FollowTail.pm#Filter

    I have no experience at all with this module. But it looks like you can call a sub when a new line appears and that sub can do what it wants with that line. Maybe my impression is wrong somehow..That's always possible!.

    I do have some experience with regex (and I'm not a regex guru by any means!). But my experience with this is that 2 regex's that don't backtrack, don't use fancy look forward features, will run faster than a single fancy regex. There are also differences between say Perl 5.6 and Perl 5.10 regex engines! Perl 5.10 is much faster if that matters to you or you can take advantage of that.

    Your problem: date1 garbage qualifying_text date2,date3,date4... fits very nicely into the algorithm of skip the lines that don't have the qualifying_text and use match global for the dates on the lines that do have the qualifying_text.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2014-09-20 04:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (152 votes), past polls