in reply to Re: Regex problems using '|'
in thread Regex problems using '|'

Whoops. I posted the wrong pattern. The one I needed to work wouldn't work correctly with the grouping behavior of (), since I had to match on unique text in record 1 to locate the same information that's at the top in the other records.

Replies are listed 'Best First'.
Re^3: Regex problems using '|'
by pjotrik (Friar) on Jul 22, 2008 at 09:48 UTC
    OK, that makes it something like:
    foreach my $vulnerabilityText (@records) { $vulnerabilityText =~ m/(Remediation report\n\n)?(.+)/; my $vulnerabilityName = $2; print($vulnerabilityName, "\n"); }
    I'm not sure about the newlines, but you'll work that out.