in reply to Using a regexp to extract sequence fields

Whenever you have delimited data, you probably want to consider using split.

For example:

my $foo = ">blabla1|anyting1|blabla2|anyting2|blabla3| "; my @fields = split /\|/, $foo;
In this case, you said you wanted the 3rd "field", so you would just access it as $fields[2]

Hope this helps,
Darren :)

Replies are listed 'Best First'.
Re^2: Using a regexp to extract sequence fields
by tamaguchi (Pilgrim) on Feb 13, 2006 at 10:09 UTC
    Yes thank you. I know there are many ways to get for example 'blabla2' out. But the expression should not be used directly for programming. In the context I should use ít it must match the sequence directly so that I get blabla2 out in $&.