in reply to Regex problems using '|'

my $foo = $1 if m/^(.+?)\n/; $foo =~ s/Remediation Report(?:\n+)?//;

Replies are listed 'Best First'.
Re^2: Regex problems using '|'
by romandas (Pilgrim) on Jul 22, 2008 at 09:32 UTC
    Thank you for your submission. I'm not sure it does what I'm looking for, however. The first record's information is buried further down, so the initial pattern won't capture the information I'm looking for. It's why there is a ^ at the beginning of the second portion of the pattern, whereas the first portion does not contain it. Effectively "Remediation Report\n\n" is the equivalent of ^, as it is the starting point for the subsequent match.