Anthony Akens wrote at Tue, 25 Jun 2002 15:49:53 +0200:

> I'm trying to find a way to match anything between two brackets [....]  The stuff in 
>between will
> have alpha, numeric, and symbols (including /  -  @ and spaces)
> 
> For instance
> 
> [akens@egh-org blah/blah/blah]
> 
> I need to match that entire string, including the []'s
> 
> Here's the ugly thing I've gotten so far to do it.  But I know there's a way to 
>simplify it and
> just match anything between the []'s.  Thanks for any advice.
> 
> \[[A-Za-z'-@]* \S+[A-Za-z'/]\]
           ^
          I think, Perl will assume all characters between a ' and @
> 

What about
m:(\[ [\w/\@'\-]* \])::x;

or quite a little more readable:

my $stuff_char = qr:[\w / \@ ' \-]:x;
m/(\[$stuff_char*\]);


Greetings,
Janek


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to