Re: Help for a complex RE

2016-05-08 Thread Peter Otten
Sergio Spina wrote: > I know about greedy and not-greedy, but the problem remains. This makes me wonder why you had to ask >>> Why the regex engine stops the search at last piece of string? >>> Why not at the first match of the group "@:"? To make it crystal clear this time: >>> import re >>>

Re: Help for a complex RE

2016-05-08 Thread Terry Reedy
On 5/8/2016 12:32 PM, Sergio Spina wrote: Il giorno domenica 8 maggio 2016 18:16:56 UTC+2, Peter Otten ha scritto: Sergio Spina wrote: In the following ipython session: Python 3.5.1+ (default, Feb 24 2016, 11:28:57) Type "copyright", "credits" or "license" for more information. IPython

Re: Help for a complex RE

2016-05-08 Thread Sergio Spina
Il giorno domenica 8 maggio 2016 18:16:56 UTC+2, Peter Otten ha scritto: > Sergio Spina wrote: > > > In the following ipython session: > > > >> Python 3.5.1+ (default, Feb 24 2016, 11:28:57) > >> Type "copyright", "credits" or "license" for more information. > >> > >> IPython 2.3.0 -- An

Re: Help for a complex RE

2016-05-08 Thread Peter Otten
Sergio Spina wrote: > In the following ipython session: > >> Python 3.5.1+ (default, Feb 24 2016, 11:28:57) >> Type "copyright", "credits" or "license" for more information. >> >> IPython 2.3.0 -- An enhanced Interactive Python. >> >> In [1]: import re >> >> In [2]: patt = r""" # the match

Help for a complex RE

2016-05-08 Thread Sergio Spina
In the following ipython session: > Python 3.5.1+ (default, Feb 24 2016, 11:28:57) > Type "copyright", "credits" or "license" for more information. > > IPython 2.3.0 -- An enhanced Interactive Python. > > In [1]: import re > > In [2]: patt = r""" # the match pattern is: > ...: .+ #