in reply to Re: Parsing text without split
in thread Parsing text without split

That has the same problem as split... It will fail for variables with spaces in them.

If you can rely on the parenthesis, it would work better as:

@line_as_list = $rtpfile[$ln] =~ /Startpoint: ([^(]+).*?clocked by ([^ +)]+)\)/;

Update: Doh! Never mind. I misread the OPs specs.

Replies are listed 'Best First'.
Re^3: Parsing text without split
by Roy Johnson (Monsignor) on May 27, 2005 at 22:42 UTC
    I took his meaning to be that the "extra words" were not part of the desired capture. You can capture multiple words with spaces by changing (\w+) to ([\w\s]+).

    Caution: Contents may have been coded under pressure.