Re: parsing combination strings

2007-03-21 Thread PKKR
On Mar 21, 2:51 pm, "Steven D. Arnold" <[EMAIL PROTECTED]> wrote: > On Mar 21, 2007, at 2:42 PM, PKKR wrote: > > > I need a fast and efficient way to parse a combination string(digits + > > chars) > > > ex: s = "12ABA" or "1ACD" or &q

Re: parsing combination strings

2007-03-21 Thread PKKR
ah ok, i guess something like this should do it for me then? re.split('[^0-9]', str)[0] -- http://mail.python.org/mailman/listinfo/python-list

parsing combination strings

2007-03-21 Thread PKKR
I need a fast and efficient way to parse a combination string(digits + chars) ex: s = "12ABA" or "1ACD" or "123CSD" etc I want to parse the the above string such that i can grab only the first digits and ignore the rest of the chacters, so if i have s = "12ABA" , parser(s) should give me "12" or