Beefy Boxes and Bandwidth Generously Provided by pair Networks DiBona
Just another Perl shrine
 
PerlMonks  

Re: regex across multiple lines

by frankus (Priest)
on Jun 28, 2002 at 09:08 UTC ( #177968=note: print w/ replies, xml ) Need Help??


in reply to regex across multiple lines

$/=undef; $_=<DATA>; s/([^\n]*printf.*?printf.*?\n)[^\n]*\n/$1/gs; print; __DATA__ This line has a printf and is multiline This line has printf and is one line This line will not be printed

Based upon the test data provided, this works.
Are we to assume that the multiline is a multiline printf function?,
if so surely the line ends with a ';'?

More information please.

--

Brother Frankus.

¤


Comment on Re: regex across multiple lines
Download Code
Re: Re: regex across multiple lines
by mndoci (Scribe) on Jun 29, 2002 at 06:17 UTC

    You were quite right. That was the real problem and of course resolved in a similar way to what was suggested. I was curious about the possiblity of solving the problem if I had been provided a file with no ';'. It appears that the question in itself is unsound.

    Regards

    mndoci

    "What you do in this world is a matter of no consequence. The question is, what can you make people believe that you have done?"-Sherlock Holmes in 'A study in scarlet'

Log In?
Username:
Password:

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

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

    April first is:







    Results (485 votes), past polls