[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Bug with sets of complements of classes
- From: "Patrick Donnelly" <batrick.donnelly@...>
- Date: Fri, 26 Oct 2007 20:28:09 -0600
Best way to show this is by example:
Lua 5.1.2 Copyright (C) 1994-2007 Lua.org, PUC-Rio
> return string.match("Hi\t 4", "[%A%S%D]")-- should be nil??
H
> return string.match("Hi\t 4", "[%S%D]") -- correct
H
> return string.match("Hi\t 4", "[%A]")-- produces tab character
> return string.match("Hi\t 4", "[%A%S]")-- wrong again : (
H
It seems Lua isn't correctly forming the union of the complements of classes : (
I couldn't find anything in the manual to say this behavior is
supposed to be undefined.
And yes I realize that:
> return string.match("Hi\t 4", "[^%a%s%d]")
nil
produces the desired behavior :P
--
-Patrick Donnelly
"One of the lessons of history is that nothing is often a good thing
to do and always a clever thing to say."
-Will Durant