Created
July 3, 2020 05:47
-
-
Save tonkotsuboy/82c354c9ad9ad58ed51204391f48c92a to your computer and use it in GitHub Desktop.
名前つきキャプチャー
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const regrex = /よく(?<food>.*)食う(?<animal>.*)だ/u; | |
const result1 = "隣の客はよく柿食う客だ".match(regrex); | |
console.log(result1.groups.food); | |
console.log(result1.groups.animal); | |
const result2 = "隣の客はよく牡蠣食う吉田拓郎だ".match(regrex); | |
console.log(result2.groups.food); | |
console.log(result2.groups.animal); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment