Created
May 12, 2015 02:26
-
-
Save nidate/fbbba621aeaba1c68fae to your computer and use it in GitHub Desktop.
node.jsのregexpの検証
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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] | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
http://developer.cybozu.co.jp/tech/?p=8757 の件、node.jsでも再現した。