SPUG: minimal unmatching regex

Yitzchak Scott-Thoennes sthoenna at efn.org
Mon Aug 24 00:10:38 PDT 2009


On Fri, August 21, 2009 11:54 pm, Michael R. Wolf wrote:
> I think /\Z\A/ (or qr( \Z \A )x without the LTS (leaning toothpick
> syndrome)) hits what you were aiming at without accidently stumbling into a
> perlvar that Ingy noticed.

/\Z\A/ should match an empty string, though.  If it doesn't, it's a bug.
/\b\B/ would work, though not necessarily efficiently for very large strings.

I can't remember if the (long deprecated, eventually removed) evil $* could
make /.^/ match.

Prior to 5.10, /(?!)/ was the canonical answer, IMO.
With 5.10, that has changed to /(*FAIL)/.




More information about the spug-list mailing list