Hello,
in the howto (http://docs.python.org/2/howto/regex.html#regex-howto)
there are code examples near the end of the page (the non-greedy
pattern) I am referring to:
s = 'Title'
>>> len(s)
32
>>> print re.match('<.*>', s).span()
(0, 32)
>>> print re.match('<.*>', s).group()
Title
print re.ma
and > from 2.
resulting in '<'
Am I right? If so, is there an easily graspable reason for the engine
designers to implement it this way?
If I'm wrong, where is my fault?
Marcin
Am 21.01.2013 17:23, schrieb Walter Prins:
> Hi,
>
>
>
> On 21 January 2013 1
-greedy
> pattern
> Message-ID: <50fdddc5.6030...@pearwood.info>
> Content-Type: text/plain; charset=UTF-8; format=flowed
>
> On 22/01/13 10:11, Marcin Mleczko wrote:
>> -BEGIN PGP SIGNED MESSAGE-
>> Hash: SHA1
>>
>> Hello Hugo, hello Wa
Hello,
given this kind of string:
"start SomeArbitraryAmountOfText start AnotherArbitraryAmountOfText end"
a search string like: r"start.*?end" would give me the entire string
from the first "start" to "end" : "start SomeArbitraryAmountOfText start
AnotherArbitraryAmountOfText end"
but I am int