You can use the emoji
library. You can check if a single codepoint is an emoji codepoint by checking if it is contained in emoji.UNICODE_EMOJI
.
import emoji
def extract_emojis(s):
return ''.join(c for c in s if c in emoji.UNICODE_EMOJI['en'])
More Related Contents:
- Test for answers in an IF block [duplicate]
- python – a collatz program automate the boring stuff [closed]
- How to provide a reproducible copy of your DataFrame with to_clipboard()
- Python 3.x rounding behavior
- Using both Python 2.x and Python 3.x in IPython Notebook
- What does the slash mean in help() output?
- error UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xff in position 0: invalid start byte
- How can I convert surrogate pairs to normal string in Python?
- Print new output on same line [duplicate]
- pip or pip3 to install packages for Python 3?
- What are good uses for Python3’s “Function Annotations”?
- How do you fix the “element not interactable” exception?
- Types that define `__eq__` are unhashable?
- What are the “parts” in a multipart email?
- Django values_list vs values
- Pip freeze vs. pip list
- Embed picture in email
- Beautifulsoup : Difference between .find() and .select()
- What is the Python 3 equivalent of “python -m SimpleHTTPServer”
- What’s the difference between ThreadPool vs Pool in the multiprocessing module?
- How to tell if a string contains valid Python code
- Python: Can a subclass of float take extra arguments in its constructor?
- Python 3.4: How to import a module given the full path? [duplicate]
- How to change all the dictionary keys in a for loop with d.items()?
- Anaconda unicode error on command line startup on Windows
- bash: Python import – Command not found for pandas
- What is the difference between super() with arguments and without arguments?
- Issue with regex backreference in Python
- How do I change the volume of the sound or music in PyGame?
- What difference between pickle and _pickle in python 3?