Hello, I'm transcoding 4 bytes hex data to an IPv4 address.
Thanks a lot for your solution : It's works ;) Regards, 2007/6/30, Tom Phoenix <[EMAIL PROTECTED]>:
On 6/29/07, marin <[EMAIL PROTECTED]> 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