On Mon, Mar 11, 2002 at 12:31:25PM +1100, [EMAIL PROTECTED] wrote: > > I know, from bitter experience with Acme::EyeDrops, just how flaky > the (?{}) construct is; normally you cannot use regular expressions > inside it at all "because Perl's regex engine is not reentrant". > And yet, mysteriously, the s///eg construct seems exempt from > this "not rentrant rule". I do not understand.
Look more closely: s/pattern1/s,pattern2,replacement,ge/ge; The second substitution is part of the *replacement* for the first substitution, not part of the pattern. Thus, when the regex engine is working on pattern2, it is not working on pattern1, and vice versa; there's no reentering going on. Ronald