in reply to Re: Re^6: Replace zero-width grouping?
in thread Replace zero-width grouping?

Why don't you use (??{ }) for that?

Makeshifts last the longest.

  • Comment on Re^8: Replace zero-width grouping? ( (??{ }) ?)

Replies are listed 'Best First'.
Re: Re^8: Replace zero-width grouping?
by diotalevi (Canon) on May 09, 2003 at 19:14 UTC

    Huh. I wouldn't have thought to use (??{}) for that and still won't. It invokes the regex compiler which isn't necessary for the code2assert I posted. This works identically except its slower.

    /(??{ # delayed regex $condition ? '' # Nothing needed - this succeeds by default : '(?!)' # Failed! })/