[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: A stupid question
- From: Tomas <tomas@...>
- Date: Fri, 11 Jan 2002 15:43:40 -0200 (BRST)
> >Another solution is like this:
> >
> > line = ' '..line..' '
> > line = gsub(line, '(%W)'..s..'(%W)', '%1'..sh..'%2') -- in the middle
> > line = strsub(line, 2, -2)
In fact, you'll have to be carefull with punctuation.
If s == "a.b" you'll have to escape it before using in the
pattern:
s = gsub (s, "(%p)", "%%%1")
So, "a.b" will be "corrected" to "a%.b". This is required for
every solutions given (mine, Roberto's ...).
Tomas