codepad
[
create a new paste
]
login
|
about
Language:
C
C++
D
Haskell
Lua
OCaml
PHP
Perl
Plain Text
Python
Ruby
Scheme
Tcl
from random import choice import re testre = re.compile('^(\w+)\s+(\w+)') def main(): start = 'hello pypy' count = 0 big = start + ''.join([choice(start) for i in range(1000000)]) for i in range(len(start) + 1, len(big)): if testre.match(buffer(big, i)): count += 1 print count if __name__ == '__main__': main()
Private
[
?
]
Run code
Submit