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

The problem is a little underspecified ... I will assume you are looking for the text between the last [ and the first ]. You need to:
ignore until you find [ read in buffer until you find [ or ] if you found ] the buffer is your result if you found [ reset buffer {optional - if you reach the end and there's no ], scream "betrayal!"}
In Perl you do
$input = ...your text here...; $result = /.*\[(.*^[)\].*/;
Match anything between [ and ], unless you find a [, otherwise you'd pick up anything between the first [ and the first ].

Hope this helps!