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

342
Views
How can I use Turkish characters in Nodejs module Regex

I want use bad-words module with Turkish characters but i cant use. How can i make this?

Sample:

var Filter = require("bad-words")

var filter = new Filter({ replaceRegex:  /[A-Za-z0-9가-힣_]/g }); 
//multilingual support for word filtering

filter.addWords('ğ', 'ü', 'ı', 'i', 'e', 'y');

filter.clean("Turkish: ğ ü ı English: i e y");

output: "Turkish: ğ ü ı English: * * *"

Try it on npm RunKit: https://npm.runkit.com/bad-words

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

0

The bad-words library does not support non-ascii letters, as it uses the ascii \b for word-boundary. Non-ascii are not even considered letters.

You can see here a proposal for a fix.

about 4 years ago · Juan Pablo Isaza Report

0

if the RegEx engine supports Unicode then you can try to match the unicode instead of characters. see 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!