Ranga Nathan wrote:
> 02 s1n1 s1n2 3 s2n1 s2n2 s2n3 1 s3n1 4 s4n1 s4n2 s4n3 s4n4

if your count of items is alway s\d+ 
and your items always include non \d,
couldn't you pick it off that way?

my $cnt = '(\d+)';
my $item = '(s\dn\d)';

$str =~ /$cnt ($item )+/

this should slurp up as many items as possible.
course, you're input could have an error with
a count of 3 followed by 4 items, but you could
check that after.

if your items are indistinguishable from 
the count, then this won't work.

Greg
_______________________________________________
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm

Reply via email to