From: petermichaux@... Date: 2006-04-02T00:58:44+09:00 Subject: Regular Expression matching biggest possible Hi, I would like to remove comments from a JavaScript file with a Ruby script. I discovered that my regular expression matching seems to match the biggest possible substring. def show_regexp(a,re) if a =~ re "#{$`}<<#{$&}>>#{$'}" else "no match" end end puts show_regexp("/* some comment */ some code /* some other comment */", /\/\*[\w\W]*\*\//) This outputs <> and I was hoping for it to find the individual comments. <> some code <> What should my regular expression be? Thanks, Peter