On Dec 12, 10:59 pm, "Zero Piraeus" <[EMAIL PROTECTED]> wrote:
> :
>
> > [...] IMHO regular
> > expressions are overkill for the task you describe. You may be better
> > served to
> > just try to convert it to whatever number you want.
>
> > try:
> > value=int(string1)
>
> Fails for the OP's
Larry Bates a écrit :
> IMHO
> regular expressions are overkill for the task you describe.
There are cases where regexps are the right tool, and according to the
exemple given, this may be one (now it's of course hard to tell without
seeing a decent sample of real data...).
--
http://mail.py
Thanks worked Perfectly
On Dec 13, 9:32 am, [EMAIL PROTECTED] wrote:
> On Dec 12, 3:10 pm, Hamish <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > Hey
>
> > I'm new to python, but I have used a fair bit of C and Perl
>
> > I found Perls regex's to be very easy to use however I don't find
> > Pythons re
:
> [...] IMHO regular
> expressions are overkill for the task you describe. You may be better served
> to
> just try to convert it to whatever number you want.
>
> try:
> value=int(string1)
Fails for the OP's example:
>>> string1 = "ABC 11"
>>> int(string1)
Traceback (most recent c
Hamish wrote:
> Hey
>
> I'm new to python, but I have used a fair bit of C and Perl
>
> I found Perls regex's to be very easy to use however I don't find
> Pythons regexes as good.
>
> All I am trying to do is detect if there is a number in a string.
>
> I am reading the string from an excel sp
On Dec 12, 3:10 pm, Hamish <[EMAIL PROTECTED]> wrote:
> Hey
>
> I'm new to python, but I have used a fair bit of C and Perl
>
> I found Perls regex's to be very easy to use however I don't find
> Pythons regexes as good.
>
> All I am trying to do is detect if there is a number in a string.
>
> I am
Hey
I'm new to python, but I have used a fair bit of C and Perl
I found Perls regex's to be very easy to use however I don't find
Pythons regexes as good.
All I am trying to do is detect if there is a number in a string.
I am reading the string from an excel spread sheet using the xlrd
module