Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: multi line regex

by Happy-the-monk (Monsignor)
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 imbibing at the Monastery: (4)
As of 2014-09-20 04:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

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











    Results (152 votes), past polls