Skip to content

Instantly share code, notes, and snippets.

@otariidae
Last active April 21, 2023 16:12
Show Gist options
  • Save otariidae/e1d70702e24cfe53cea1910eb358715e to your computer and use it in GitHub Desktop.
Save otariidae/e1d70702e24cfe53cea1910eb358715e to your computer and use it in GitHub Desktop.
アツアツのゴハン
const regexp = /^(?:(?<a>\p{scx=Katakana}[ァィゥェォャュョヮ]?)(?<tsu>\p{scx=Katakana}+)){2}の(?<go>\p{scx=Katakana}[ァィゥェォャュョヮ]?)(?<han>\p{scx=Katakana}*)$/u
const atsuatsugohan = "アツアツのゴハン"
const gotsugotsuahan = atsuatsugohan.replace(regexp, "$<go>$<tsu>$<go>$<tsu>の$<a>$<han>")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment