Match unicode emoji in python regex
<p>I need to extract the text between a number and an emoticon in a text</p>

<p>example text:</p>

<pre><code>blah xzuyguhbc ibcbb bqw 2 extract1  âºï¸ jbjhcb 6 extract2 í ½í¹ bjvcvvv
</code></pre>

<p>output:</p>

<pre><code>extract1
extract2
</code></pre>

<p>The regex code that I wrote extracts the text between 2 numbers, I need to change the part where it identifies the unicode emoji characters and extracts text between them.</p>

<pre><code>(?&lt;=[\s][\d])(.*?)(?=[\d])
</code></pre>

<p>Please suggest a python friendly method, and I need it to work with all the emoji's not only the one's given in the example</p>

<p><a href="https://regex101.com/r/uT1fM0/1" rel="nofollow">https://regex101.com/r/uT1fM0/1</a></p>

<p>So this may or not work depending on your needs. If you know the emoji's ahead of time though this will probably work, you just need a list of the types of emoticons to expect.</p>

<p>Anyway without more information, this is what I'd do.</p>

<pre><code>#!/usr/bin/env python
# -*- coding: utf-8 -*-

import re

my_regex = re.compile(r'\d\s*([^âºï¸|^í ½í¹]+)')

string = "blah xzuyguhbc ibcbb bqw 2 extract1  âºï¸ jbjhcb 6 extract2 í ½í¹ bjvcvvv"

m = my_regex.findall(string)
if m:
  print m
</code></pre>

python regex unicode emoji