Thanks, yours responses gave me the opportunity to understand the
"backreference" feature, it was not clear in spite of my intensive study
of the well known RE howto manual.
--
http://mail.python.org/mailman/listinfo/python-list
On 3/31/2011 10:20 PM, Tim Chase wrote:
On 03/31/2011 07:43 PM, candide wrote:
"pyyythhooonnn ---> "
and you search for the subquences composed of the same character, here
you get :
'yyy', 'hh', 'ooo', 'nnn', '---', ''
Or, if you want to do it with itertools instead of the "re" modul
On 03/31/2011 07:43 PM, candide wrote:
"pyyythhooonnn ---> "
and you search for the subquences composed of the same character, here
you get :
'yyy', 'hh', 'ooo', 'nnn', '---', ''
Or, if you want to do it with itertools instead of the "re" module:
>>> s = "pyyythhooonnn ---> "
>>
On 03/31/2011 07:43 PM, candide wrote:
Suppose you have a string, for instance
"pyyythhooonnn ---> "
and you search for the subquences composed of the same character, here
you get :
'yyy', 'hh', 'ooo', 'nnn', '---', ''
>>> import re
>>> s = "pyyythhooonnn ---> "
>>> [m.group(0)
In article <4d952008$0$3943$426a7...@news.free.fr>,
candide wrote:
> Suppose you have a string, for instance
>
> "pyyythhooonnn ---> "
>
> and you search for the subquences composed of the same character, here
> you get :
>
> 'yyy', 'hh', 'ooo', 'nnn', '---', ''
I got the following.
On 01/04/2011 01:43, candide wrote:
Suppose you have a string, for instance
"pyyythhooonnn ---> "
and you search for the subquences composed of the same character, here
you get :
'yyy', 'hh', 'ooo', 'nnn', '---', ''
It's not difficult to write a Python code that solves the problem, fo
Suppose you have a string, for instance
"pyyythhooonnn ---> "
and you search for the subquences composed of the same character, here
you get :
'yyy', 'hh', 'ooo', 'nnn', '---', ''
It's not difficult to write a Python code that solves the problem, for
instance :
def f(text):
ch