Skip to content

Instantly share code, notes, and snippets.

@k-kurikuri
Created December 19, 2015 19:13
Show Gist options
  • Save k-kurikuri/e48cab9d279bce46fbd2 to your computer and use it in GitHub Desktop.
Save k-kurikuri/e48cab9d279bce46fbd2 to your computer and use it in GitHub Desktop.
Chatworkの[To:number] NameのNameを削除するJavascript
var textArea = document.getElementById('_chatText');
var replaced = textArea.value.replace(/\[To:\d*\](.*\n)/g, function (matchStr, groupStr) {
return matchStr.replace(groupStr, '');
});
textArea.value = replaced;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment