The alternate way (much worse than hv's IMO) that you sometimes see is (IIRC) /^(.(?!$regex))*\z/s
In reply to Re^2: negative regex without !~ by ysth in thread negative regex without !~ by mbr