Re: How to find out if a string is contained within another string

2007-10-16 Thread Marty Alchin
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

Re: How to find out if a string is contained within another string

2007-10-16 Thread Andreas Pfrengle
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

Re: How to find out if a string is contained within another string

2007-10-15 Thread [EMAIL PROTECTED]
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: > > >

Re: How to find out if a string is contained within another string

2007-10-15 Thread Greg
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

Re: How to find out if a string is contained within another string

2007-10-15 Thread Andreas Pfrengle
> 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