Murcia has asked for the wisdom of the Perl Monks concerning the following question:
I have a long html text. For this text I want to get all database Identifiers (4 letters, beginning with a digit (not 0)) e.g 1TGS These IDs are introduced by the database name (PDB) e.g. PDB ID 1TGS || PDB code ID 1TGS || PDB 1TGS. These terms can occure multiple times in the text. $string = "<html>Test text PDB code ID 1TGS 1O6S 1TGS bla bla \nPDB codebut how to get all IDs?? Thanks in advance! Yours Murcia
1ILW 1ILV"; I want to get all these IDs. this is not correct: while($string=~/(?<=PDB).+?([1-9][A-Z0-9]{3})/g){ print $1, "\n";}
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Regexp find all matches
by holli (Abbot) on Mar 03, 2005 at 10:05 UTC | |
|
Re: Regexp find all matches
by tphyahoo (Vicar) on Mar 03, 2005 at 12:43 UTC | |
|
Re: Regexp find all matches
by manav (Scribe) on Mar 03, 2005 at 10:13 UTC | |
by Murcia (Monk) on Mar 03, 2005 at 10:14 UTC | |
by manav (Scribe) on Mar 03, 2005 at 11:37 UTC |