Hi,

At Fri, 6 Dec 2002 11:59:12 +0900,
dblack / candle.superlink.net wrote:
> > since ruby's comments continue till line's end, i guess there is no
> > way to embed comments in a single line regex?  or is there?
> 
> All I can think of is:
> 
>   irb(main):003:0> /ab#{"This is a comment"*0}c/.match("abc")
>   #<MatchData:0x401e3990>

In 1.7, this is more efficient.
  /ab#{"This is a comment";""}c/.match("abc")

Preceding literal is eliminated by successive literal, the
regexp is compiled to a static literal.

-- 
Nobu Nakada