grep -Pãªãã·ã§ã³ã使ã£ã¦è¤æ°è¡ãæ¤ç´¢ããæ¹æ³ grepã¯åä¸è¡ã®ã¿ããæ¤ç´¢ã§ããªãã®ãã¨æã£ã¦ãããããªãã·ã§ã³ã使ãã¨ã§ãããã¨ãåãã£ãã ä¾ã¨ãã¦ãæ¤ç´¢å¯¾è±¡ã®ããã¹ãtest.txtã«ä»¥ä¸ã®ããã«æ¸ããã¦ããã¨ããã aaabbbccc dddeeefff ggghhhiiiãã®ããã¹ãããããbbbã§å§ã¾ã£ã¦dddã§çµããæååããæ¤ç´¢ããã®ã¯ä»¥ä¸ã®ããã«ããã°ã§ããã $ grep -P 'bbb[\s\S]*?ddd' test.txt è¨å·ã®æå³ãç°¡åã«è§£èª¬ã -Pãªãã·ã§ã³ã¯ãPerl風ã®æ£è¦è¡¨ç¾ã使ãã¨ããæå³ã [\s\S]ã¯æ¹è¡æåãå«ãããã¹ã¦ã®æå1æåã«ãããã *?ã§ã[\s\S]ã®ç¹°ãè¿ãã®ãã¡ãã£ã¨ãçããã®ã«ãããã ãã®ã³ãã³ãã§è¡¨ç¤ºãããçµæã¯ä»¥ä¸ã aaabbbccc dddeeefffããã ã¨ãæ±ããæååãå«ãè¡ãã¨ãã¹ã¦è¡¨ç¤ºããã¦ãã¾
{{#tags}}- {{label}}
{{/tags}}