Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: multi line regex

by Happy-the-monk (Abbot)
on Jan 09, 2006 at 14:39 UTC ( #521945=note: print w/ replies, xml ) Need Help??


in reply to multi line regex

You read the file into an array of lines, then you compare single lines against something that suspiciously looks like a multi-line-structure. You probably have to slurp the whole file into the scalar and not use the for loop:

my $entry = do { local $/; <INFO> }; # slurp the whole file

To which Corion adds:

with the /x modifier you will have to match all the whitespace explicitly, meaning to put \s+ here and there and everywhere you might expect whitespace.

Cheers, Sören


Comment on Re: multi line regex
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (10)
As of 2015-07-31 19:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (280 votes), past polls