in reply to Splitting into variables columned data without delimiters with a regexp ?

If I understand your requirements, you need to get 11 characters, split in a group of 6 and one of 5. The code below just does this (using the metacharacter .).

my $s = "xabcdefghijXABCDEFGHIJ01234567890"; while ($s =~ /(......)(.....)/g) { print "$1 $2\n"; }
HTH and have fun benchmarking, Rata

  • Comment on Re: Splitting into variables columned data without delimiters with a regexp ?
  • Download Code

Replies are listed 'Best First'.
Re^2: Splitting into variables columned data without delimiters with a regexp ?
by gerleu (Novice) on Nov 01, 2011 at 09:42 UTC
    Thank you Ratazong, I will investigate your suggestion too !