in reply to Re^2: regexp: non-capturing grouping in replacement possible?
in thread regexp: non-capturing grouping in replacement possible?

?= is look ahead. try ?<= (look behind)
  • Comment on Re^3: regexp: non-capturing grouping in replacement possible?

Replies are listed 'Best First'.
Re^4: regexp: non-capturing grouping in replacement possible?
by moritz (Cardinal) on Nov 26, 2009 at 14:23 UTC
    That's right. The regex engine walks the string from left to right, so looking left of a pattern is a look-behind, looking right of a pattern is a look-ahead.
Re^4: regexp: non-capturing grouping in replacement possible?
by diweooy (Novice) on Nov 26, 2009 at 14:26 UTC
    thanks :). working great. $str =~ s/^(?<=hello kitty )(\d\d*)(?=x\d+.*)/sprintf "%d", $1/e;;