You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert
æ£è¦è¡¨ç¾ã«ããããªãã¼ã·ã§ã³çã§ãå®å ¨ä¸è´ã示ãç®ç㧠^ 㨠$ ãç¨ããæ¹æ³ãä¸è¬çã§ãããæ£ãã㯠\A 㨠\z ãç¨ããå¿ è¦ãããã¾ããRubyã®å ´å ^ 㨠$ ã使ã£ã¦å®å ¨ä¸è´ã®ããªãã¼ã·ã§ã³ãè¡ãã¨èå¼±æ§ãå ¥ããããã¯ãã¨ãªãã¾ããPerlãPHPã®å ´åã¯ãRubyç¨ã§ã¯ããã¾ãããä¸å ·åãçããã®ã§ \A 㨠\z ã使ãããã«ãã¾ãããã ã¯ãã㫠大å£ããã®ããã°ã¨ã³ããªãPHPeråããRuby/Railsã®è½ã¨ãç©´ãã«ã¯ãRubyã®è½ã¨ãç©´ã¨ãã¦ãå®å ¨ä¸è´æ¤ç´¢ã®æå®ã¨ãã¦ãæ£è¦è¡¨ç¾ã® ^ 㨠$ ãæå®ããä¾ããRuby on Rails Security Guideããã®å¼ç¨ã¨ãã¦ç´¹ä»ããã¦ãã¾ãã以ä¸ã®æ£è¦è¡¨ç¾ã¯ãXSS対çã¨ãã¦ãhttpã¹ãã¼ã ãããã¯httpsã¹ãã¼ã ã®URLã®ã¿ã許å¯ããæ£è¦è¡¨ç¾ã®ã¤ããã§ãã /^https?:\/\/[^\n]+$/
æåã«, çããã«ãã©ã¦ã¶ã¼ã®ã³ã³ã½ã¼ã«ã§/.*/()ã試ãã¦ããã ããã. ããã¦, ä»ã®ã¿ãã¨ãè²ã 試ãã¦æ¬²ãã. ã©ããªæåãè¿ã£ã¦ãã¾ããã? å¤åä¸æãããªãã¯ã. ãã©ãã©. ã¯ã±ãåãããªãã. ããã§, ãã®ã¨ã³ããªã¼ãæãåºãã. (åã«ãè¦ããã¨ãã£ã...) typeofæ¼ç®åããå¦ã¶JavaScriptã®ãã¼ã¿åã®æ¦å¿µã¨é¢ä¿ããèå¯ã®ã¾ã¨ã(id:sandai) ãã¨ããããã§ããã©ã«ãã§execã¡ã½ãããå¼ã³åºãããããã«ãªã£ã¦ãã¾ããã ãããªã®ã...execãªã®ã. ECMA-262ã®ã©ãã«æ¸ãã¦ãã®ãã¯åãããªããã©(âã...) ã¾ãããã. /.*/.exec()ã£ã¦ãªããã¨ã¯åãã£ã. ....function is not a functionã®è§£èª¬ã¯ãã®ã¨ã³ããªã¼ã«ä»»ããã¨ãã¦... .execã«å¼æ°ããªãå ´åã©ããªãã®ã? æåããè¦ã¦ã¿ã¦æã
IPv6 Address Validation ã¨è¨ããµã¤ããããã¾ããIPv6ã¢ãã¬ã¹ã¨ãã¦å¦¥å½ããã§ãã¯ãã¦ãããä¸ã«ãRFC5952ã«åã£ã表è¨ãæãã¦ããã¾ãã ããã§ã¯æ£è¦è¡¨ç¾ã«ãã£ã¦IPv6ã¢ãã¬ã¹ã¨ãã¦æ£ãããè©ä¾¡ãã¦ãã¾ãã ããã¯ã以ä¸ã®ãããªæ£è¦è¡¨ç¾ã§ãã IPv6ã¢ãã¬ã¹ããããããã å§ç¸®æ¸ã¿IPv6ã¢ãã¬ã¹ã§ãããããã IPv4ã¢ãã¬ã¹ãå«ã¾ãã¦ãã¦ãããããã ãªã³ã¯ãã¼ã«ã«ã¢ãã¬ã¹ãèå¥ããçºã®ã¤ã³ã¿ã¼ãã§ã¼ã¹åãå«ã¾ãã¦ãã¦ãããããã ((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9
ã¿ã¤ãã«å¤ãã¾ãããæ§ã¿ã¤ãã«ãJavaScriptã§ãã使ãæ¸ãæ¹ãããã使ããã©æ¯åå¿ããã æ£è¦è¡¨ç¾ã«ããããããã©ããã RegExp#testã使ãã /abc/.test("abcdefg") // => true String#searchã¯ãããããä½ç½®ãè¿ãããããããªãå ´åã¯-1ãå é ã«ãããããã¨0ã§falseãªã®ã§æ³¨æãçå½å¤ã欲ããå ´åã¯String#searchã使ããªãã "abcdefg".search(/xxx/) // => -1 "abcdefg".search(/def/) // => 3 "abcdefg".search(/abc/) == false // => true æ£è¦è¡¨ç¾ã®é¨åããããå¾ãã é¨åããããå¾ãã«ã¯ãRegExp#execãString#matchã使ããexecã¨matchã®é度ã¯å¤§ãã¦å¤ãããªãã æ£è¦è¡¨ç¾ã®ãã³ããã¼
ä¸è¬ã«ãã»ãã¥ã¢ã³ã¼ãã£ã³ã°ã®åºæ¬ã¨ãã¦å ¥åå¤ã®æ¤è¨¼ï¼Validationï¼ãããã¨ãããã¨ã«ãªã£ã¦ãã¾ããããããå¤ãªæ¹åã«è¡ãã¨ããããããµãã¿ã¤ãºãã®ãããªææ³ã«ãªã£ã¦ãã¾ãã¾ãã以åãææããããã«ãã¢ããªã±ã¼ã·ã§ã³ã¨ãã¦ã®Validationã¯ä»æ§ã«å¾ã£ã¦è¡ãã¹ããã®ã§ãã ã§ãããæ¦ãã©ã®å ´åã§ãè¡ãã¹ãæ¤è¨¼ã¨ãã¦ä»¥ä¸ãããã¨æãã¾ãã æåã¨ã³ã³ã¼ãã£ã³ã°ã®å¦¥å½å§ å¶å¾¡æå(\x00ã\x1f, \x7f)ã®ãã§ã㯠æååé·ã®ãã§ã㯠ãã®ãã¡å¾ãäºã¤ãæ£è¦è¡¨ç¾ã¨ãã¦æ¸ãã«ã¯ã©ãããã°ããããèãã¦ãã¾ãããã¤ã¾ãããå¶å¾¡æå以å¤ã®æåã§mæå以ä¸næå以ä¸ãã¨ãããããªãã§ãã¯ã§ããmæå以ä¸ãnæå以ä¸ã¯ã{m,n}ã§æ¸ããã®ã§ãåé¡ã¯ãå¶å¾¡æå以å¤ã®æåãã§ããããã¯textã¿ã¤ãã®inputè¦ç´ ã§ããã¤ã¢ããªã±ã¼ã·ã§ã³ä»æ§ã¨ãã¦ã¯æå種ã®å¶éãããªãå ´åãæ³å®ãã¦ã
ããã¯ä¾¿å©ã var counter = function () { var static = /(^o^)/; return ('i' in static)? ++static.i: static.i = 0; }; console.log(counter()); // 0 console.log(counter()); // 1 console.log(counter()); // 2 console.log(counter()); // 3 æ£è¦è¡¨ç¾ãªãã©ã«ã¯æ¯å解éãããããã§ã¯ãªããä¸åº¦ä½ãããã¨åããªãã¸ã§ã¯ãã使ãããã®ã§staticå¤æ°ã®ãããªæåããããã ãããRegExp#lastIndexã¨ããç´æ¥å¼ãæã¯ããæ°ãã¤ããªãã¨ãããªãã
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}