lua-users home
lua-l archive

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


I think this already demonstrates my point. Coming up with a regex
that is safe and escapes everything is not trivial.

On Wed, Aug 20, 2014 at 10:02 PM, Shmuel Zeigerman <shmuz@013net.net> wrote:
> On 20/08/2014 22:36, Petite Abeille wrote:
>>
>>
>> On Aug 20, 2014, at 9:03 PM, Jonas Thiem <jonasthiem@googlemail.com>
>> wrote:
>>
>>> Alternatively, I'm also happy for easier solutions to get this
>>> behavior of gsub if this is already possible in an easier way that I
>>> haven't seen.
>>
>>
>> gsub( '%p', '%%%0’ ) seems hardy ‘monstrous’.
>>
>
> On my system, '%p' does not match '[+$^]', so '%p' should become '[%p+$^]'.
>
> --
> Shmuel
>