Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

229
Views
Why telegram emoji numbers are not deleted when removing special characters

I have a telegram bot and I want to remove all special characters and just returns numbers and A-Z,but the problem is that my regex pattern can remove any emojies except numbers like this :1️⃣2️⃣3️⃣4️⃣5️⃣6️⃣

I want to delete emoji numbers too

So this is my pattern :

text = '1️⃣Hi =) 1.This regex removes 2️⃣all special 6️⃣characters like this !@$#%^&*()_+=~`/\><.⚠️4️⃣'

text.toUpperCase().match(/[a-z]+|\d+(?:\.\d+)?/gi)
    .map((m) => (isNaN(m) ? m : +m))

//Current output : 
// [1,'HI',1,'THIS','REGEX','REMOVES',2,'ALL', 'SPECIAL',6,'CHARACTERS', 'LIKE','THIS']


//What I want : 
// ['HI',1,'THIS','REGEX','REMOVES','ALL', 'SPECIAL','CHARACTERS', 'LIKE','THIS']

Also I don't know why it removed the last number emoji from string! (4️⃣)

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

These numbers are emojis. To remove them, too, use the following:

text = '1️⃣Hi =) 1.This regex removes 2️⃣all special 6️⃣characters like this !@$#%^&*()_+=~`/\><.⚠️4️⃣'

console.log(
  text.toUpperCase().match(/[a-z]+|(?!\d\uFE0F\u20E3)\d+(?:\.\d+)?/gi)
    .map((m) => (isNaN(m) ? m : +m))
)

The (?!\d\uFE0F\u20E3) negative lookahead will fail any match of \d+(?:\.\d+)? when the first digit is a part of the numeric emojis.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!