Subject: Strange regexp behaviour in gsub
From: Kristof Bastiaensen <kristof vleeuwen.org>
Date: Wed, 12 May 2004 08:03:59 +0900
Hi,
I am wondering if this is the correct behaviour in gsub:
"bab".gsub(/(?!a)ab/, "cd")
=> "bab"
shouldn't that be "bcd"?
Also the following:
"\nab".gsub(/(?!\w)ab/, "cd")
=> "\nab"
This seems to work
"bab".gsub(/(?!c)ab/, "cd")
=> "bcd"
Kristof