[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: gsub strangeness
- From: "Peter Loveday" <peter@...>
- Date: Wed, 28 Aug 2002 17:56:00 -0400
I'm having some odd behaviour with gsub in 5.0 alpha; If I call:
gsub("string", ".+", "x")
It will return "x", 1, whch is what I'd expect. However, if I use:
gsub("string", ".*", "x")
then it returns "xx", 2
Now I guess technically .* matches an empty string, so one could argue that
it would make an infinite number of replacements.
However, given that it says it matches the longest possible string in the
docs, I would've expected to get a single substitution, not 2.
Love, Light and Peace,
- Peter Loveday
Director of Development, eyeon Software