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 ( [id://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

Replies are listed 'Best First'.
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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1062772]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (4)
As of 2024-03-29 07:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found