shabird has asked for the wisdom of the Perl Monks concerning the following question:
I have a file in which i have the following line
BOGUS PPI3_SYNY3 276 aa linear BCT 13-NOV-2019
I want to extract BOGUS PPI3_SYNY3 and "276 aa" using regular expression. my code is as follows
$content =~ /BOGUS\s+([A-Z0-9_]+)/; $bogus = $1; $noOfAcids =~ /\s+([0-9\sa-z]$)/; $acids = $1 ; print("bogus: $bogus\nNumber of acids:$acids\n
but unfortunately both regex gives the same output.
OUTPUT
bogus: PPI3_SYNY3
Number of amino acids:PPI3_SYNY3
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: getting a sequence of numbers and leters
by choroba (Cardinal) on Mar 23, 2020 at 17:48 UTC | |
|
Re: getting a sequence of numbers and leters
by johngg (Canon) on Mar 23, 2020 at 23:17 UTC | |
by Marshall (Canon) on Mar 24, 2020 at 18:21 UTC | |
|
Re: getting a sequence of numbers and leters
by hippo (Archbishop) on Mar 23, 2020 at 21:39 UTC | |
by shabird (Sexton) on Mar 24, 2020 at 07:06 UTC | |
|
Re: getting a sequence of numbers and leters
by BillKSmith (Monsignor) on Mar 23, 2020 at 22:59 UTC | |
| A reply falls below the community's threshold of quality. You may see it by logging in. |