in reply to Re: Parsing a line from a line with one line of perl code.
in thread Parsing a line from a line with one line of perl code.

$ cat foo.pl use strict; use warnings; my $string = qq{<Prompt><![CDATA[Please ... question ). ]]> <![CDATA[[ + FAIL. ]]></Prompt>}; my( $fail ) = $string =~ m{ \[CDATA\[ (.*) ]]> }xms; print $fail, "\n"; my( $better ) = $string =~ m{ \[ CDATA \[ (.*?) \]\] }x; print $better, "\n"; $ perl foo.pl Please ... question ). ]]> <![CDATA[[ FAIL. Please ... question ).

Addendum: I mean it's not like this topic gets discussed every other week around here or something . . .