Re: Feature request: plain option for gsub
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: Feature request: plain option for gsub
- From: Oliver Kroth <oliver.kroth@...>
- Date: 2014年8月21日 17:08:46 +0200
HI,
possibly reading page 215 in PiL3 could help you...the trick is to use
gsub() three times:
match = match:gsub("(%W)", "%%%1")
replace = replace:gsub( "%%", "%%%%")
changed = original:gsub( match, replace)
--
Oliver
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.
Regards,
Jonas Thiem