Re: strfind gsub - plain option
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: strfind gsub - plain option
- From: Roberto Ierusalimschy <roberto@...>
- Date: 2002年4月17日 13:46:39 -0300
> Please let me know why gsub() doesn't accept a plain option?
I guess the main reason was that it is not very common the use of gsub
over a fixed string. Anyway, there is an easy way to protect a pattern:
function plaingsub (s, p, r)
p = gsub(p, '(%W)', '%%%1')
return gsub(s, p, r)
end
-- Roberto