Skip to content

Instantly share code, notes, and snippets.

@nidate
Created May 12, 2015 02:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nidate/fbbba621aeaba1c68fae to your computer and use it in GitHub Desktop.
Save nidate/fbbba621aeaba1c68fae to your computer and use it in GitHub Desktop.
node.jsのregexpの検証
# http://developer.cybozu.co.jp/tech/?p=8757
{sprintf} = require 'sprintf-js'
pattern = /(\w|_){1,64}@/
#pattern = /(\w){1,64}@/
for i in [1..64]
target = [1..i].reduce ((p, n)-> p + '_'), ''
start = process.hrtime()
pattern.exec(target)
elapsed = process.hrtime(start)
console.log sprintf "%d,%d.%06d sec", i, elapsed[0], elapsed[1]
@nidate
Copy link
Author

nidate commented May 12, 2015

http://developer.cybozu.co.jp/tech/?p=8757 の件、node.jsでも再現した。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment