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

169
Views
Remove all Right to Left Characters in discord.js leaderboard

Hello there I just wanted to ask if there is a way to remove all right-to-left characters. I am aware of .replace(/\u200f/g, "") and .replace(/[^\x00-\x7F]/g, "") but they have not really helped with my leaderboards since the former still doesn't remove the rtl characters and the latter only removes all non-ascii characters which also involves characters that aren't written from left to right. if there was a possible fix for replacing all characters from languages that are read from right to left, i would be very grateful

Here is the sample input

acc.tag.replace(/\u200f/g, "")

and here is the sample output

 1. PersonA#1333 - 8052.7x
 2. PersonB#3169 - 8035.3x
 3. PersonC#7619 - 7541x
PersonD#7797 - 7529.5x.๐ž ”๐ž ” 4

or when I do .replace(/[^\x00-\x7F]/g, "") it outputs the following(sample):

 4. PersonA#1333 - 8052.7x
 5. PersonB#3169 - 8035.3x
 6. PersonC#7619 - 7541x
 4. #4327 - 6553.4x

in the above scenario, it replaced ๐๐ซ๐ŸŽ๐ฐ๐ง๐๐Ÿ‘๐š๐œ๐ก as "" since it consists of non ASCII characters but its not a rtl text.

about 4 years ago ยท Juan Pablo Isaza
1 answers
Answer question

0

I think you're looking for this RegExp /[\u04c7-\u0591\u05D0-\u05EA\u05F0-\u05F4\u0600-\u06FF]/gi.

It matches both Hebrew and Arabic, and doesn't match Emojis or special non-RTL Unicode characters. See the regexr tests here

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!