æ¦è¦ å¾èªã¿ã¯ãä½ããç´åã«æ¥ãç®æ¨ããæãéã«ä¾¿å©ãªè¡¨ç¾ã§ããã 解説 å
èªã¿ã(?=pattern)ã ãpatternã®ç´åã®ä½ç½®ã«ãããããã®ã«å¯¾ãã¦ã å¾èªã¿ã(?<=pattern)ãã¯patternã®ç´å¾ã®ä½ç½®ã«ãããããã ã©ã¡ããpatternèªä½ã«ã¯ãããããªãã å
èªã¿ããä½ããç¶ãç®æ¨ããæãã®ã«åãã¦ããã®ã«å¯¾ãã¦ã å¾èªã¿ã¯ãä½ãã«ç¶ãç®æ¨ããæãã®ã«åãã¦ããã ä¾ åºæ¬ï¼ // è¯å®çå¾èªã¿ï¼lightãdeepã«ç¶ãè²ãåãåºã let str1 = 'red, deep green, light blue, white' str1.match(/(?<=(?:[light|deep] ))\w+/g) // ["green", "blue"] // å¦å®çå¾èªã¿ï¼200Xå¹´ãé¤ãã¦é
ç®ãåãåºã let str2 = '1997:ES1\n1998:ES
{{#tags}}- {{label}}
{{/tags}}