SPUG: minimal unmatching regex

Michael R. Wolf MichaelRWolf at att.net
Wed Aug 19 07:07:34 PDT 2009


On Aug 18, 2009, at 10:37 PM, Damian Conway wrote:

>> What's the smallest (comprehensible) regex that's guaranteed to  
>> fail against
>> all input?
>
> /(?!)/
>
> "Look ahead and *don't* find...nothing".
> Oops! Too late. You already found nothing. ;-)
>
> Damian

Clever.  I figured I could count on a former-professor to pass the  
'always fail' test...

-- 
Michael R. Wolf
     All mammals learn by playing!
         MichaelRWolf at att.net






More information about the spug-list mailing list