On Mar 16, 2008, at 21:02 , Adam Akhtar wrote:

>
> Hi if have
>
> str = "ruby is ((Great))"
>
> how do i use regex to find text between the start marker (( and end
> marker ))?
>
> Im new to regex but I tried this
>
> \(\(([^((|^))]*)\)\)
>
> but it includes the markers in the capture i.e. it gives ((Great))  
> when
> i just want Great.

The fact that the parens are delimiters obscures the regexp a bit.  
Assuming "))" ends the text to extract unconditionally you can simply  
use .*? like this

    irb(main):001:0> "ruby is ((Great))".match(/ \(\( (.*?) \)\) /mx)[1]
    => "Great"

-- fxn