On 08/10/10 20:30, MRAB wrote:
Tim Chase wrote:
r = re.compile(r'((.)\1*)')
#r = re.compile(r'((\w)\1*)')
That should be \2, not \1.
Alternatively:
r = re.compile(r'(.)\1*')
Doh, I had played with both and mis-transcribed the combination
of them into one malfunctioning regexp.
Tim Chase wrote:
On 08/10/10 19:37, candide wrote:
Suppose you have a sequence s , a string for say, for instance this
one :
spppaeggg
We want to split s into the following parts :
['s', 'ppp', 'a', '', 'e', 'ggg', '']
ie each part is a single repeated character word.
Whi
On 08/10/10 19:37, candide wrote:
Suppose you have a sequence s , a string for say, for instance this one :
spppaeggg
We want to split s into the following parts :
['s', 'ppp', 'a', '', 'e', 'ggg', '']
ie each part is a single repeated character word.
While I'm not sure it'
On Tue, Aug 10, 2010 at 5:37 PM, candide wrote:
> Suppose you have a sequence s , a string for say, for instance this one :
>
> spppaeggg
>
> We want to split s into the following parts :
>
> ['s', 'ppp', 'a', '', 'e', 'ggg', '']
>
> ie each part is a single repeated character wor
Suppose you have a sequence s , a string for say, for instance this one :
spppaeggg
We want to split s into the following parts :
['s', 'ppp', 'a', '', 'e', 'ggg', '']
ie each part is a single repeated character word.
What is the pythonic way to answer this question?
A naive