in reply to Re: empty hits with regex
in thread empty hits with regex

In 5.10, there's a much easier solution: (?|).
$_ = "caaat"; my @hits = /(?|c(a)|k(t))/g; say scalar @hits; say @hits; __END__ 1 a

Replies are listed 'Best First'.
Re^3: empty hits with regex
by Tanktalus (Canon) on Oct 02, 2008 at 22:52 UTC

    You just made me want to get our infrastructure team to upgrade to perl 5.10. Thanks. Now I'm not going to get any real work done next week.