Hi Robert

thanks for your objection, but could you shortly explain the
difference (for regexp dummies like me)?

Fritzek

On 18 Sep., 22:13, Robert Klemme <shortcut... / googlemail.com> wrote:
> On 18.09.2008 17:47, Fritzek wrote:
>
> > Hi Sebastian
>
> > thanks for the solution. works perfect.
>
> > Fritzek
>
> > On 18 Sep., 17:31, Sebastian Hungerecker <sep... / googlemail.com>
> > wrote:
> >> Fritzek wrote:
> >>> short question how to use regexp the right way
> >>> given is a=3D"a[b]c"
> >>> I nedd b=3D"a c"
> >> "a[b]c".gsub(/\[.*?\]/, " ")
>
> Not sure whether it makes a difference performance wise but I am always
> reluctant to use reluctant quantifiers. =A0I'd rather do
>
> irb(main):003:0> "a[b]c".gsub /\[[^\]]*\]/, ' '
> =3D> "a c"
>
> Kind regards
>
> =A0 =A0 =A0 =A0 robert