Regular expression: zero-width look-behind?

Hi,

How do I use zero-width look-behind in regular expression? I tried
f.sub!(/(?<=\w)-/, ’ ')

But I got an error message:
undefined (?..) sequence: /(?<=\w)-/

Thanks in advance for any help.

Lei

Apparently, you can’t. Looks like Ruby, at least as of 1.8pre2,
doesn’t support lookbehind. Lookahead, yes; lookbehind, no.

-Mark

···

On Thu, Jul 17, 2003 at 01:26:27PM -0700, Lei Wu wrote:

How do I use zero-width look-behind in regular expression? I tried
f.sub!(/(?<=\w)-/, ’ ')

Hi,

···

At Fri, 18 Jul 2003 05:40:04 +0900, Lei Wu wrote:

How do I use zero-width look-behind in regular expression? I tried
f.sub!(/(?<=\w)-/, ’ ')

You have to wait 1.9 or compile ruby with Oniguruma.


Nobu Nakada