[#407] New feature for Ruby? — Clemens.Hintze@...

Hi all,

27 messages 1999/07/01
[#413] Re: New feature for Ruby? — matz@... (Yukihiro Matsumoto) 1999/07/01

Hi Clemens,

[#416] Re: New feature for Ruby? — Clemens Hintze <c.hintze@...> 1999/07/01

On Thu, 01 Jul 1999, Yukihiro Matsumoto wrote:

[#418] Re: New feature for Ruby? — gotoken@... (GOTO Kentaro) 1999/07/01

Hi

[#426] Re: New feature for Ruby? — gotoken@... (GOTO Kentaro) 1999/07/02

Hi,

[#440] Now another totally different ;-) — Clemens Hintze <c.hintze@...>

Hi,

21 messages 1999/07/09
[#441] Re: Now another totally different ;-) — matz@... (Yukihiro Matsumoto) 1999/07/09

Hi,

[#442] Re: Now another totally different ;-) — Clemens Hintze <c.hintze@...> 1999/07/09

On Fri, 09 Jul 1999, you wrote:

[#443] — Michael Hohn <hohn@...>

Hello,

26 messages 1999/07/09
[#444] interactive ruby, debugger — gotoken@... (GOTO Kentaro) 1999/07/09

Hi Michael,

[ruby-talk:00417] regular expression lookbehinds

From: Julian R Fondren <julian@...>
Date: 1999-07-01 16:16:18 UTC
List: ruby-talk #417
I'd like to suggest that the zero-width lookbehind and negative
lookbehinds in regular expressions which are:
  (?<=PATTERN) - zero-width positive lookbehind assertion
  (?<!PATTERN) - zero-width negative lookbehind assertion
be included into ruby's Regex. They allow problems such as "How do I
delete all but the first three characters of a string?" to be solved
idiomatically as s/(?<=...).+// and the like in a readable and convienent
way where the currently-existing lookaheads just wouldn't work as well.

Code that I currently have as:
  if line =~ /(?!\\).?#{$splitchar}/
could be so much better and make so much more sense as:
  if line =~ /(?<=\\)#{$splitchar}/
whereas the above version is just hackish and less versatile. (and I
notice now that the first version doesn't even *work*, grr...)

Thank you,

In This Thread