å èªã¿æ£è¦è¡¨ç¾ã«ã¤ãã¦ããã®åãã£ã¨ç解ã§ãããRubyãªãã¡ã¬ã³ã¹ããã¥ã¢ã«ã§ã¯ãããªèª¬æã«ãªã£ã¦ããã (?= ) å èªã¿(lookahead)ããã¿ã¼ã³ã«ããä½ç½®æå®(å¹ ãæããªã) (?=re1)re2 ã¨ãã表ç¾ã¯ãre1 㨠re2 両æ¹ã«ããããããã®ã«ãããããæ£è¦è¡¨ç¾ã§ãã re1(?=re2) ã¨ãã表ç¾ã¯ãå¾ã« re2 ã¨ãããããæååãç¶ããæ£è¦è¡¨ç¾ re1 ã§ãã p /foo(?=bar)/ =~ "foobar" # => 0 p $& # => "foo" (bar ã®é¨åã®æ å ±ã¯ãªã) (?! ) å¦å®å èªã¿(negative lookahead)ããã¿ã¼ã³ã®å¦å®ã«ããä½ç½®æå®(å¹ ãæããªã) (?!re1)re2 ã¨ãã表ç¾ã¯ãre1 ã«ãããããªãã re2 ã«ã¯ãããããæ£è¦è¡¨ç¾ã§ãã # 000 ãé¤ã 3 æ¡ã®æ°å re = /(?!000)\
{{#tags}}- {{label}}
{{/tags}}