grep problem under NetBeans 6.1 Windows
Is this the right forum to post problems?
The following 3-line script fails under NetBeans (returns Nil) but works when running Ruby from the console or in SciTE (returns ["a", "b"]).
x = ["fa"]
p = /^f(.+)$/
puts x.grep(p){|z| Regexp.last_match(1)}
However this script works the same in all the environments (returns ["fa", "fb"]).
x = ["fa", "fb"]
p = /^f(.+)$/
puts x.grep(p){|z| z}
I have tried this with both Ruby platforms in NetBeans and the result is the same. It also doesn't matter whether I am running in Debug mode or Run mode. I installed the JDK freshly for the NetBeans install.
Any suggestions on what else I should try?
I am on Windows XP Pro, SP2
Can others duplicate the problem?