On Fri, 23 Jul 2004, Steve Bertrand wrote:

> Perl hackers -- Figured someone would have a reasonably quick, easy answer
> for this:
>
> I am trying to read through a file, line-by-line, and I want to extract
> the text in between the [ and ] characters.

This is a job for......capturing parens!!!

Try this:

if ($_=~/\[(.+)\]/) {
        $var=$1;
}

$1 would be the string matched by the regex between ( and )



                        Fer
_______________________________________________
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to