lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hi experts,

can anybody explain the following:

    s = "/one/two/three"
    print(s:match("/.-$"))   --> /one/two/three

Shouldn't the result be "/three"? To me it seems clear that "three" is the shortest character sequence between '/' and the end of the string.
This variant works as expected:

    print(s:match("/[^/]-$"))	--> /three

Regards,
Bernd

--
http://sudrala.de