Created
June 18, 2024 09:17
-
-
Save baptistemanson/7ce05c80e557b8d127cd7e2c4813771f to your computer and use it in GitHub Desktop.
remove-mentions.js
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 test = `f notification shows [@jane](http://staging/uuid) sdfjhabsdfan sf asdfjknsadf sad ff notification | |
shows [@hector](http://staging/3fd21asd32sa1f3as2d1fas32fd1a-asdfasdfa2sdf)`; | |
const result = `f notification shows @jane sdfjhabsdfan sf asdfjknsadf sad ff notification | |
shows @hector`; | |
const reg = /\[(@[^\]]*)\]\([^)]*\)/gm; | |
const testResult = test.replace(reg, "$1"); | |
console.log(result === testResult); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment