[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Difference in string matching between 5.1 and 5.2
- From: Craig Barnes <craigbarnes85@...>
- Date: Mon, 2 Dec 2013 06:01:29 +0000
On 2 December 2013 05:23, Dirk Laurie <dirk.laurie@gmail.com> wrote:
> I can't understand the following.
>
> $ lua
> Lua 5.2.2 Copyright (C) 1994-2013 Lua.org, PUC-Rio
>> utfpat = "[\xC0-\xEF][\x80-\xBF]*"
>> s="the quick brown fox jumps over the lazy dog"
>> =s:find(utfpat)
> nil
>>
> $ lua515
> Lua 5.1.5 Copyright (C) 1994-2012 Lua.org, PUC-Rio
>> utfpat = "[\xC0-\xEF][\x80-\xBF]*"
>> s="the quick brown fox jumps over the lazy dog"
>> =s:find(utfpat)
> 1 3
>>
>
Lua 5.1.x doesn't recognize hex escapes in strings. They we're added in 5.2.
Try:
lua515 -e 'print("[\xC0-\xEF][\x80-\xBF]*")'
v.s.
lua -e 'print("[\xC0-\xEF][\x80-\xBF]*")'