Re: how to get references from imbricated capturing parenthesis ?
- From: rootbeer@xxxxxxxxxx (Tom Phoenix)
- Date: Fri, 29 Jun 2007 16:07:26 -0700
On 6/29/07, marin <marin.jb@xxxxxxxxx> wrote:
I'm trying to get references from a simple regular exepression like
this :
"a40d7412" =~ /(([[:xdigit:]]{2})*)/;
print "$1: <$2><$3><$4><$5>\n";
How to get all references and not the last one in the second
parenthesis pair ?
I don't think you're looking for references; those are described in
the perlref manpage. You're using regular expressions, described in
the perlre manpage (and elsewhere). Is that the source of your
confusion?
I think you're looking to get every hex digit pair you can match,
maybe? You could use m//g in list context:
my @matches = "a40d7412" =~ /([[:xdigit:]]{2})/g;
But that may not be what you want, especially if your data isn't just
hex. Good luck with it!
--Tom Phoenix
Stonehenge Perl Training
.
- References:
- Prev by Date: Re: How can i make a perl program lauch another perl program that takes options
- Next by Date: Re: Adding a line in a file inside many directories
- Previous by thread: how to get references from imbricated capturing parenthesis ?
- Next by thread: Re: how to get references from imbricated capturing parenthesis ?
- Index(es):