tags:

views:

123

answers:

1

Duplicate of: http://stackoverflow.com/questions/20448/what-is-the-most-brilliant-regex-youve-ever-used

I was reading about using a regular expression to solve Sudoku, and so was wondering what other useful or interesting regular expressions people have come up with.

+2  A: 
/^1?$|^(11+?)\1+$/

This regex checks for primary numbers.

I don't think it works for very large primary numbers but its interesting though.

Ólafur Waage