Another way just using a global match with an alternation of look-behinds rather than split.
$ perl -E ' $_ = q{1 AC2 34 TRP A 6 ALA A 7 ILE A 14 GLY A 15}; say for m{(?: (?<=\A) | (?<=\s) )( (?:\S+\s+){2} \S+ ) }gx;' 1 AC2 34 TRP A 6 ALA A 7 ILE A 14 GLY A 15 $
I hope this is useful.
Cheers,
JohnGG
In reply to Re: Split at specific spaces
by johngg
in thread Split at specific spaces
by perl_search_m
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |