ashinn / irregex

Portable Efficient IrRegular Expressions for Scheme

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Replacements of positive lookbehinds only replace first match

sjamaan opened this issue · comments

Reported on chicken-users:

irregex-replace/all only replaces first match when negative lookbehinds are involved

example:

the following regexp should replace any letter a preceded by x, y, or z

problematic code

(irregex-replace/all "(?<=[xyz])a"     "xa ya za"  "-")
; or 
(irregex-replace/all '(: (look-behind (or "x" "y" "z")) "a")   "xa ya za"  "-")

should return "x- y- z-" BUT actually returns "x- ya za"

That was me in chicken-users. Holler if there's anything else you need from me. I should probably note that as far as i can tell this works fine with look-aheads, just not look-behinds.

Fixed, thanks!