Regular expression

Fredrik Lundh fredrik at pythonware.com
Wed Jul 16 10:14:35 EDT 2008


Beema shafreen wrote:

> How do I write a regular expression for this kind of sequences
> 
>  >gi|158028609|gb|ABW08583.1| CG8385-PF, isoform F [Drosophila melanogaster]
> MGNVFANLFKGLFGKKEMRILMVGLDAAGKTTILYKLKLGEIVTTIPTIGFNVETVE

line.split("|") ?

it's a bit hard to come up with a working RE with only a single sample; 
what are the constraints for the different fields?  is the last part 
free form text or something else, etc.

have you googled for existing implementations of the format you're using?

</F>




More information about the Python-list mailing list