I've used them for things like string matching:

/"(.*?)(?<!\\)"/

Note: that pattern doesn't allow you to escape backslashes, but it's a
quick example, and the sort of thing I've used in the past.


On 28 September 2013 12:05, Tamara Temple <tamouse.lists / gmail.com> wrote:

>
> On Sep 27, 2013, at 3:02 PM, Hal Fulton <rubyhacker / gmail.com> wrote:
>
> > Who of you here frequently use lookahead/lookbehind
> > in Ruby regular expressions?
> >
> > I'm thinking hard about purpose/usage of these, and would
> > like some more examples...
> >
> > If you consider it too far off-topic, you may email me.
> >
> > Cheers,
> > Hal
> >
>
> I have to admit, I've only found the need for them exactly twice in the
> past couple decades, and I can't even remember where, exactly (but they
> were the perfect answer). I always forget about them and find something
> else to solve my immediate problem. Maybe I should use them more=85
>
>


--=20
  Matthew Kerwin, B.Sc (CompSci) (Hons)
  http://matthew.kerwin.net.au/