You can set up your regular expression like so:
import re
number_re = re.compile(r'\d+')
And then when you want to pull numbers out of the string, you can use this line:
number_list = number_re.findall(input_string)
That will give you a list of all the numbers in the string, or an
empty list
Since I haven't much experience with regex, I also can't give you the
solution right away. Perhaps you have to try a bit:
http://docs.python.org/lib/re-syntax.html
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Dj
Should be trivial to do with a regular expression.
On Oct 15, 10:29 am, Greg <[EMAIL PROTECTED]> wrote:
> Andres,
> Using Python...how would I take out all the numeric subsequences in my
> message and store them in a list?
>
> On Oct 15, 3:11 am, Andreas Pfrengle <[EMAIL PROTECTED]> wrote:
>
> >
Andres,
Using Python...how would I take out all the numeric subsequences in my
message and store them in a list?
On Oct 15, 3:11 am, Andreas Pfrengle <[EMAIL PROTECTED]> wrote:
> > I'm thinking that I might have to create a for loop, which loops
> > through every Discounter record and checks to
> I'm thinking that I might have to create a for loop, which loops
> through every Discounter record and checks to see if the 'code'
> variable is in the 'message variable.
Depending on the number of your Discounter-records, this can result in
many queries.
Perhaps instead you could take every con
5 matches
Mail list logo