Jaya has asked for the wisdom of the Perl Monks concerning the following question:
the line is as follows:
12..13 13..14 14..15 15..1 15..2 14..3 13..16 16..4 16..17 17..5 17..18 18..6 18..7 12..19 19..20 20..8 20..10 19..9 12..11
I tried all ways of getting that line and i failed. The combinations i tried are:
That was the last thing i tried the others are :for(my $i = 0; $i <= $#filedata; ++$i){ if($filedata[$i] =~ m/\d\.\.\d/){ my $branch = $filedata[$i];}} print("$branch \n");
Suggestions are welcome on how to get this lineif($filedata[$i] =~ m/\d..\d/) if($filedata[$i] =~ m/\.\./) if($filedata[$i] =~ m/\d+\.\.\d+/) if($filedata[$i] =~ m/../) if($filedata[$i] =~ m/\../)
After getting this line I again need to seperate and have 12..13, 13..14, 14..15 etc..
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Regular expressions and metacharacters
by halley (Prior) on Apr 07, 2005 at 01:14 UTC | |
|
Re: Regular expressions and metacharacters
by tlm (Prior) on Apr 07, 2005 at 01:21 UTC | |
|
Re: Regular expressions and metacharacters
by inman (Curate) on Apr 07, 2005 at 10:50 UTC | |
|
Re: Regular expressions and metacharacters
by ryantate (Friar) on Apr 07, 2005 at 01:15 UTC | |
|
Re: Regular expressions and metacharacters
by lidden (Curate) on Apr 08, 2005 at 02:15 UTC |