Regular expression visualizer using railroad diagrams
ãã®è¨äºã¯Vim Advent Calendar 2012ã®166æ¥ç®ã®è¨äºã§ãã 165æ¥ç®ã¯aueweããã«ãã.vimrcã«æ¸ãã¹ãã§ãªãVimã®è¨å®é ç®ã§ããã Vimã«éãã¾ããããããã¹ãã¨ãã£ã¿ã使ãéã«ããã¹ãæ¤ç´¢ã¯ãã使ãã¨æãã¾ãã ããç¨åº¦æ £ãã人ã ã¨æ£è¦è¡¨ç¾ãç¨ãããã¿ã¼ã³æ¤ç´¢ã使ãããã«ãªãã¾ãã ãã¡ãããVimã«ãæ£è¦è¡¨ç¾ãç¨ãããã¿ã¼ã³æ¤ç´¢ãè¡ãæ©è½ã¯åãã£ã¦ãã¾ãã ãããããä¸è¾ã«ãVimã®ããã©ã«ãè¨å®ã§ã¯ãã¿ã¼ã³æ¤ç´¢ã¯æ¸ããããã¨ã¯è¨ãã¾ããã ç¹ã«ãä»ã®æ£è¦è¡¨ç¾æ¹è¨ã«æ £ãã¦ãã人ã¯ãVimã®æ£è¦è¡¨ç¾ã®æ¸ãæ¹ã®éãã«æ¸æãã¨æãã¾ãã æ¬è¨äºã§ã¯ãVimã§ãã¿ã¼ã³æ¤ç´¢ãããªãç¥ã£ã¦ãããã»ãããããã¨ï¼ Vimã®ãã¿ã¼ã³æ¤ç´¢ã«ä½¿ããã¡ã¿æåããç´¹ä»ãã¾ãã ãã¿ã¼ã³ã£ã¦ä½ï¼ã¨ããæ¹ã¯:help usr_27.txtãä¸èªãããã¨ããããããã¾ãã ä¸
æ£è¦è¡¨ç¾ã«ããããªãã¼ã·ã§ã³çã§ãå®å ¨ä¸è´ã示ãç®ç㧠^ 㨠$ ãç¨ããæ¹æ³ãä¸è¬çã§ãããæ£ãã㯠\A 㨠\z ãç¨ããå¿ è¦ãããã¾ããRubyã®å ´å ^ 㨠$ ã使ã£ã¦å®å ¨ä¸è´ã®ããªãã¼ã·ã§ã³ãè¡ãã¨èå¼±æ§ãå ¥ããããã¯ãã¨ãªãã¾ããPerlãPHPã®å ´åã¯ãRubyç¨ã§ã¯ããã¾ãããä¸å ·åãçããã®ã§ \A 㨠\z ã使ãããã«ãã¾ãããã ã¯ãã㫠大å£ããã®ããã°ã¨ã³ããªãPHPeråããRuby/Railsã®è½ã¨ãç©´ãã«ã¯ãRubyã®è½ã¨ãç©´ã¨ãã¦ãå®å ¨ä¸è´æ¤ç´¢ã®æå®ã¨ãã¦ãæ£è¦è¡¨ç¾ã® ^ 㨠$ ãæå®ããä¾ããRuby on Rails Security Guideããã®å¼ç¨ã¨ãã¦ç´¹ä»ããã¦ãã¾ãã以ä¸ã®æ£è¦è¡¨ç¾ã¯ãXSS対çã¨ãã¦ãhttpã¹ãã¼ã ãããã¯httpsã¹ãã¼ã ã®URLã®ã¿ã許å¯ããæ£è¦è¡¨ç¾ã®ã¤ããã§ãã /^https?:\/\/[^\n]+$/
æ£è¦è¡¨ç¾ã¨ããã°ã主ã«sedãawkã¨ãã£ãUNIXã®ã³ãã³ãã§ããããã¯PerlãPHPãJavaScriptãªã©ã®ã¹ã¯ãªããè¨èªã®ä¸ãªã©ã§ãããã°ã©ãã¼ãæååãæä½ããããã«ä½¿ãéå ·ã§ããã ãã®æ£è¦è¡¨ç¾ãHTML5ã§ãµãã¼ããããè¦éãã§ãããã¾ã¾ã§æ£è¦è¡¨ç¾ã使ããã«æ¸ãã§ãããã¶ã¤ããã³ã¼ãã¼ã¨ãã£ãè·ç¨®ã®æ¹ã ãããããä»äºã¨ãã¦ãã¡ãã¨æ£è¦è¡¨ç¾ãæ±ããªããã°ãªããªãæ代ããã£ã¦ãã¾ãã HTML5ã®ã©ãã«æ£è¦è¡¨ç¾ã使ããããã«ãªãã®ï¼ æ£è¦è¡¨ç¾ã¯ãinputè¦ç´ ã®patternå±æ§ã®ä¸ã§ä½¿ãããã¨ã«ãªãäºå®ã§ããW3Cã2009å¹´8æ25æ¥ä»ãå ¬éãã¦ããHTML5ã®ã¯ã¼ãã³ã°ãã©ããã®ã4.10 Formsãã®ã4.10.4.2.8 The pattern attributeãã§ã¯æ¬¡ã®ããã«è¨è¼ããã¦ãã¾ãã The pattern attribute specifies a
2009å¹´03æ09æ¥00:30 ã«ãã´ãªLightweight LanguagesTips regexp - ^$ã§ãªãã¦\A\zã使ãã ã¾ãã¯åçããã æ£è¦è¡¨ç¾ã§ãå¶å¾¡æå以å¤ãã®ãã§ã㯠- ockeghem(徳丸浩)ã®æ¥è¨ æåã¨ã³ã³ã¼ãã£ã³ã°ã®å¦¥å½å§ å¶å¾¡æå(\x00ã\x1f, \x7f)ã®ãã§ã㯠æååé·ã®ãã§ã㯠ãã®ãã¡å¾ãäºã¤ãæ£è¦è¡¨ç¾ã¨ãã¦æ¸ãã«ã¯ã©ãããã°ããããèãã¦ãã¾ããã ããããæã«ã¯ããå ¨æåãOKãªãOKãã¨èããã®ã§ã¯ãªãããä¸æåã§ãNGãªãNGãã¨èããã¨æ¥½ã«ãªãã¾ããããã¯ãã¹ãã¼ã¹ã¨éå¶å¾¡æå以å¤ããªã®ã§ãããã/[^ \S]/ãæ±ãã¦ããæ£è¦è¡¨ç¾ã§ã=~ã§ã¯ãªã!~ã使ãã¹ãæ¼ç®åã¨ãããã¨ã«ãªãã¾ããå ¨è§ã¹ãã¼ã¹ãOKã«ããããã°ã/[^ \x{3000}\S]/ã[追è¨åç §] [Run via Codepad] #!perl -
CodeZineç·¨éé¨ã§ã¯ãç¾å ´ã§æ´»èºãããããããã¼ãã¹ã¿ã¼ã«ããããã®ã«ã³ãã¡ã¬ã³ã¹ãDevelopers Summitãããã¨ã³ã¸ãã¢ã®çããã¾ããã¼ã¹ãããããã®ã¤ãã³ããDevelopers Boostããªã©ããã¾ãã¾ãªã«ã³ãã¡ã¬ã³ã¹ãä¼ç»ã»éå¶ãã¦ãã¾ãã
jokergaming สลà¹à¸à¸à¸à¸à¸à¹à¸¥à¸à¹à¸à¸µà¹à¸¡à¸²à¹à¸£à¸à¸à¸µà¹à¸ªà¸¸à¸ à¹à¸à¸£à¸à¸´à¸à¸à¸£à¸µ jokergaming สลà¹à¸à¸à¸à¸à¸à¹à¸¥à¸à¹à¸à¸µà¹à¸¡à¸²à¹à¸£à¸à¸à¸µà¹à¸ªà¸¸à¸ à¹à¸à¸£à¸à¸´à¸à¸à¸£à¸µ 100 à¹à¸¡à¹à¸à¹à¸à¸à¸à¸²à¸ à¹à¸à¸§à¸±à¸à¸à¸µà¹à¸à¸²à¸à¹à¸§à¹à¸à¹à¸à¸à¹à¸à¸à¸à¹à¸£à¸² à¸à¸°à¸à¸à¹à¸ªà¸à¸à¸à¹à¸à¸¡à¸¹à¸¥ à¹à¸à¸¡à¸ªà¸¥à¹à¸à¸à¸à¸£à¸µà¹à¸à¸£à¸à¸´à¸ 100 à¹à¸à¸à¹à¸¡à¹à¸à¹à¸à¸à¸à¸²à¸ à¹à¸à¸à¹à¸¡à¹à¸à¹à¸à¸à¹à¸à¸£à¹ à¹à¸à¸·à¹à¸à¹à¸¥à¸¢à¸§à¹à¸² มัà¸à¸à¸·à¸à¸«à¸à¸¶à¹à¸à¹à¸à¸à¸³à¸à¸²à¸¡ à¸à¸µà¹à¸à¸±à¸à¸à¸à¸±à¸à¸¡à¸·à¸à¹à¸«à¸¡à¹à¸à¸à¸±à¸ªà¹à¸à¸£à¸à¸´à¸à¸à¸£à¸µ à¸à¸²à¸à¹à¸§à¹à¸à¸à¸£à¸à¸à¸±à¹à¸ สามารà¸à¸à¸à¸à¹à¸à¹à¸à¸£à¸´à¸ ๠à¹à¸¥à¹à¸§ à¹à¸à¸¢à¹à¸£à¸² à¸à¸³à¸à¸²à¸£à¸ªà¸¡à¸±à¸à¸£à¸ªà¸¡à¸²à¸à¸´à¸à¸à¸±à¸à¹à¸§à¹à¸ à¹à¸¥à¸°à¹à¸à¹à¸à¸à¸²à¸£à¹à¸à¸´à¸à¹à¸à¸à¸²à¸ª à¹à¸«à¹à¸à¸±à¸à¸à¸¹à¹à¹à¸¥à¹à¸à¹à¸«à¸¡à¹ ๠à¹à¸à¹à¹à¸à¹à¸²à¸¡à¸²à¸à¸à¸¥à¸à¸à¹à¸¥à¹à¸à¹à¸à¸¡ à¹
æ£è¦è¡¨ç¾ã¯ä¾¿å©ãªãã¨ãã®ä¸ãªãæè¡ã ããããã®æ¸ãééããåå ã§ãã°ã£ãããããã£ãããããã¨ããã®ä¸ãªãå¤ãã?ãå ¥ããã¨ããæ¹è¡ãå«ãã¦å¤æããã¨ããã£ãã¨ãããããééãããããã ã¾ããããã°ã©ã ã®ä¸ã§ä½¿ã£ã¦ããã¨åç¾ãããã®ãé¢åã ã£ããããã¹ãã§å®è¡ãããããã®ã大å¤ã ãããã§ããã使ã£ã¦å¹çããæ£è¦è¡¨ç¾ãçµã¿ç«ã¦ããã ä»åç´¹ä»ãããªã¼ãã³ã½ã¼ã¹ã»ã½ããã¦ã§ã¢ã¯Visual REGEXPãGUIã§è©¦ããæ£è¦è¡¨ç¾ãã¹ãã½ããã¦ã§ã¢ã ã Visual REGEXPã¯ä¸ã«å¯¾è±¡æååãä¸ã«æ£è¦è¡¨ç¾ãæ¸ãã¦ãã¡ãã¨ããããããã試ããã¨ãã§ãããæ¥æ¬èªã使ã£ãæ£è¦è¡¨ç¾ã§ããããããã大æåå°æåã®åºå¥ãæ¹è¡ã³ã¼ãã®æ±ããªã©ã¯ãã§ãã¯ããã¯ã¹ã§æå®ã§ããã 試ãã ãã§ãªããç½®æãã¦å¤æãããã¨ãå¯è½ã ãä¾ãã°ããã¹ããã¡ã¤ã«ã®æåãç½®ãæããããããã ã£ããããã°ã©ãã³ã°ãªãã§å®äºããã
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}