On Sep 21, 2007, at 4:04 PM, crybaby wrote:
> import re
>
> s1 =' 25000 '
> s2 = ' 5.5910 '
>
> mypat = re.compile('[0-9]*(\.[0-9]*|$)')
> rate= mypat.search(s1)
> print rate.group()
>
> rate=mypat.search(s2)
> print rate.group()
> rate = mypat.search(s1)
> price = float(rate.group())
> print pri
crybaby wrote:
> import re
>
> s1 =' 25000 '
> s2 = ' 5.5910 '
>
> mypat = re.compile('[0-9]*(\.[0-9]*|$)')
> rate= mypat.search(s1)
> print rate.group()
>
> rate=mypat.search(s2)
> print rate.group()
> rate = mypat.search(s1)
> price = float(rate.group())
> print price
>
> I get an error when
On Sep 21, 5:04 pm, crybaby <[EMAIL PROTECTED]> wrote:
> import re
>
> s1 =' 25000 '
> s2 = ' 5.5910 '
>
> mypat = re.compile('[0-9]*(\.[0-9]*|$)')
> rate= mypat.search(s1)
> print rate.group()
>
> rate=mypat.search(s2)
> print rate.group()
> rate = mypat.search(s1)
> price = float(rate.group())
>
import re
s1 =' 25000 '
s2 = ' 5.5910 '
mypat = re.compile('[0-9]*(\.[0-9]*|$)')
rate= mypat.search(s1)
print rate.group()
rate=mypat.search(s2)
print rate.group()
rate = mypat.search(s1)
price = float(rate.group())
print price
I get an error when it hits the whole number, that is in this forma