in reply to Re^2: Work-around for variable length look-behind?
in thread Work-around for variable length look-behind?
Does that take care of the "in front of an 'a'" requirement?
Er, no. I missed that bit of the spec, but it is easily corrected:
$s = 'bbaaccbab sdbcbalsbadcbnw';; ## with added bs ($t = $s) =~ s[(b)(?=a[^\s]+$)][B]g; print $t;; bbaaccbab sdbcBalsBadcbnw
|
|---|