Re: regex: multiple matching for one string

2009-07-24 Thread rurpy
Scott David Daniels wrote: > ru...@yahoo.com wrote: >> Nick Dumas wrote: >>> On 7/23/2009 9:23 AM, Mark Lawrence wrote: scriptlear...@gmail.com wrote: > For example, I have a string "#a=valuea;b=valueb;c=valuec;", and I > will like to take out the values (valuea, valueb, and valuec).

Re: regex: multiple matching for one string

2009-07-24 Thread Scott David Daniels
ru...@yahoo.com wrote: Nick Dumas wrote: On 7/23/2009 9:23 AM, Mark Lawrence wrote: scriptlear...@gmail.com wrote: For example, I have a string "#a=valuea;b=valueb;c=valuec;", and I will like to take out the values (valuea, valueb, and valuec). How do I do that in Python? The group method wi

Re: regex: multiple matching for one string

2009-07-23 Thread rurpy
Nick Dumas wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Agreed. Two string.split()s, first at the semi-colon and then at the > equal sign, will yield you your value, without having to fool around > with regexes. > > On 7/23/2009 9:23 AM, Mark Lawrence wrote: >> scriptlear...@gmail.c

Re: regex: multiple matching for one string

2009-07-23 Thread tiefeng wu
2009/7/23 scriptlear...@gmail.com : > For example, I have a string "#a=valuea;b=valueb;c=valuec;", and I > will like to take out the values (valuea, valueb, and valuec).  How do > I do that in Python?  The group method will only return the matched > part.  Thanks. > > p = re.compile('#a=*;b=*;c=*;'

Re: regex: multiple matching for one string

2009-07-23 Thread Bill Davy
"Mark Lawrence" wrote in message news:mailman.3588.1248355389.8015.python-l...@python.org... > scriptlear...@gmail.com wrote: >> For example, I have a string "#a=valuea;b=valueb;c=valuec;", and I >> will like to take out the values (valuea, valueb, and valuec). How do >> I do that in Python? Th

Re: regex: multiple matching for one string

2009-07-23 Thread Nick Dumas
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Agreed. Two string.split()s, first at the semi-colon and then at the equal sign, will yield you your value, without having to fool around with regexes. On 7/23/2009 9:23 AM, Mark Lawrence wrote: > scriptlear...@gmail.com wrote: >> For example, I have

Re: regex: multiple matching for one string

2009-07-23 Thread Mark Lawrence
scriptlear...@gmail.com wrote: For example, I have a string "#a=valuea;b=valueb;c=valuec;", and I will like to take out the values (valuea, valueb, and valuec). How do I do that in Python? The group method will only return the matched part. Thanks. p = re.compile('#a=*;b=*;c=*;') m = p.match(

Re: regex: multiple matching for one string

2009-07-22 Thread rurpy
On Jul 22, 7:45 pm, "scriptlear...@gmail.com" wrote: > For example, I have a string "#a=valuea;b=valueb;c=valuec;", and I > will like to take out the values (valuea, valueb, and valuec). How do > I do that in Python? The group method will only return the matched > part. Thanks. > > p = re.compi

regex: multiple matching for one string

2009-07-22 Thread scriptlear...@gmail.com
For example, I have a string "#a=valuea;b=valueb;c=valuec;", and I will like to take out the values (valuea, valueb, and valuec). How do I do that in Python? The group method will only return the matched part. Thanks. p = re.compile('#a=*;b=*;c=*;') m = p.match(line) if m: