in reply to Using a regexp to extract sequence fields
results in:#!/usr/bin/perl use strict; my $string = '>blabla1|anyting1|blabla2|anyting2|blabla3|'; # with split my $third = (split(/\|/, $string))[2]; # with regex my ($third_regexed) = $string =~ /^[^\|]+\|[^\|]+\|([^\|]+)\|.*/; print "splitted: $third\nregexed: $third_regexed\n";
splitted: blabla2 regexed: blabla2
|
|---|