Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
The fastest one I found (the only one I tried that was faster than the /(.).*\1/ variations) was certainly not the shortest:
But it was about twice as fast. Update: Added the '^' to make failure cases fast. The (?=.*?0) asserts that $digits contains a '0'. If that fails, then the regex fails. If a '0' is found, then (since that was a look-ahead assertion), we start over at the beginning of $digits and (?=.*?1) asserts that $digits contains a '1'. etc. - tye In reply to Re: Determining uniqueness in a string. (2x)
by tye
|
|