Idenfity numbers in variables
alfons.nonell at upf.edu
Mon Oct 20 13:16:48 CEST 2008
I have a trouble and I don't know how to solve it. I am working with
molecules and each molecule has a number of atoms. I obtain each atom
spliting the molecule.
Ok. It is fine and I have no problem with it.
The problem is when I have to work with these atoms. These atoms usually
are only a letter but, sometimes it can also contain one o more numbers.
If they contein a number I have to manipulate them separately.
If the number was allways the same I know how to identify them, for
atom = 'C1'
if '1' in atom:
But, how can I do to identify in '1' all possibilities from 1-9, I
if '[1-9]', \d,...
Any comments, please?
Alfons Nonell-Canals, PhD
Research Group on Biomedical Informatics (GRIB) - IMIM/UPF
Parc de Recerca Biomèdica de Barcelona (PRBB)
C/ Doctor Aiguader, 88 - 08003 Barcelona
alfons.nonell at upf.edu - http://cgl.imim.es
More information about the Python-list