Last active
September 21, 2023 05:28
-
-
Save andrewp-as-is/110d66d6075f1b8ec6503b8624d0f238 to your computer and use it in GitHub Desktop.
emoji remove
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
#!/usr/bin/env python | |
import re | |
s = 'word1 :blush: word2' | |
print(re.sub(':[^:]+:', '', s).strip()) |
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
#!/usr/bin/env bash | |
echo "word1 :blush: word2" | sed 's/:.*://' | |
echo ":blush: word2" | sed 's/:.*://' | sed "s/^[ \t]*//" | sed 's/[ \t]*$//' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There is a better CLI version:
https://gist.github.com/hinell/ae068ac7d993e6387b993fc0283fc1d9