Update: above solution better as:#!/usr/bin/perl use strict; use warnings; $_ = '1 AC2 34 TRP A 6 ALA A 7 ILE A 14 GLY A 15'; print join "\n", /\S+(?: \S+){1,2}/g;
print "$1\n" while /(\S+(?:\s+\S+){0,2})/g;
In reply to Re: Split at specific spaces
by Cristoforo
in thread Split at specific spaces
by perl_search_m
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |