/ Published in: Regular Expression
                    
                                        
By the legendary abigail.  Fails to match if and only if it is matched against a prime number of 1's.  That is, '11' fails, but '1111' does not.
I once heard him talk why this works, but I forgot most of it.
                I once heard him talk why this works, but I forgot most of it.
                            
                                Expand |
                                Embed | Plain Text
                            
                        
                        Copy this code and paste it in your HTML
^1?$|^(11+?)\1+$
Comments
 Subscribe to comments
                    Subscribe to comments
                
                