Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Regex returns match the first time. It returns everything thereafter

by RMGir (Prior)
on Nov 15, 2013 at 18:45 UTC ( #1062772=note: print w/ replies, xml ) Need Help??


in reply to Regex returns match the first time. It returns everything thereafter

What do you think

/line/../\\Z/
does?

What it actually parses out as is this:

perl -MO=Deparse -e'$line =~ /line/../\\Z/' $line =~ /line/ .. /\\Z/;
That means it's a flip-flip (perlop for more info on that), which means it stays true after the first regex matches until the 2nd matches (which it probably never does).

What were you trying to do?


Mike


Comment on Re: Regex returns match the first time. It returns everything thereafter
Select or Download Code
Re^2: Regex returns match the first time. It returns everything thereafter
by guitarplayer68 (Novice) on Nov 15, 2013 at 20:45 UTC

    Hi Mike,
    What I think the regex does is this. It matches from 'line' to the end of the string. As for what I was trying to accomplish. I'm trying to grab the contents of a file which lives across several servers but only return the lines in the file which occure after the line, "customizations must be after this line." I'll read up on perlop this weekend and see what i can learn.
    Thank you for your reply.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (7)
As of 2014-07-13 23:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (252 votes), past polls