in reply to RegEx on more than one line
To pull an entire multi-line record into $_ in a single read iteration, play with the "$/" (record-separator) variable:
$/ = '---------End Data--------\n'; # or whatever while (<>) { if (/name\s+-+\s+(.*)/) { # "\s+" matches "\n", "(.*)" doesn't $whatIwant = $1; # do something with $whatIwant... } }
|
|---|