javascript 정규식에서 global flag 사용하면 정규식 객체가 lastIndex를 유지? 한다는걸 저만 몰랐나요? ^^;; http://stackoverflow.com/questions/6891545/javascript-regexp-test-returns-false-even-though-it-should-return-true This is a common behavior that the the exec or test methods show when you deal with patterns that have the global g flag.The RegExp object will keep track of the lastIndex where a match was found, and then on..
http://todomvc.com/
for(b = i = 0 ; c = s.charCodeAt(i++) ; b += c>>7 ? 2 : 1) {return b;} value로 부터 50자리 문자 깨짐 없이 가져오기value = (function(s, b, i, c){for(b = i = 0 ; c = s.charCodeAt(i++) ; b += c>>7 ? 2 : 1){if(b == 50){return s.substring(0, i - 1); }else if(b == 51){return s.substring(0, i - 2); }}return s;})(value);