From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <6f7681f231c72358687d477638a8c6b1@vitanuova.com> To: 9fans@cse.psu.edu Subject: Re: [9fans] regexp not greedy enough Date: Wed, 12 May 2004 14:57:47 +0100 From: rog@vitanuova.com In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Topicbox-Message-UUID: 77c94742-eacd-11e9-9e20-41e7f4b1d025 > Why? How do I get the whole region? nothing matches a newline except a newline itself. so instead of: \/\*[^\/]* i think you might want: \/\*([^\/]|\n)* (BTW, it is possible to write a regexp to properly match C-style comments, but it's quite involved. minimal matching would make it quite easy, but i guess there are good reasons not to implement it)