Short utility post. Two public gists I reuse:

The gotcha

Some Bangla words use the zero-width joiner U+200D, for example র‍্যাব (র + ZWJ + ্ + য + া + ব). U+200D is not in the Bengali block (U+0980–U+09FF), so:

"র\u200D্যাব ID: ১২৩".split(/([\u0980-\u09FF]+)/u).filter(Boolean) // ["র", "\u200D", "্যাব", " ID: ", "১২৩"] 

The word is split into three pieces. If you split mixed text into runs, allow U+200C and U+200D inside a Bangla run:

/([\u0980-\u09FF](?:[\u0980-\u09FF\u200C\u200D]*[\u0980-\u09FF])?)/u 

(Checked with Node on 2 Dec 2026. Test on your own data before relying on it.)

Not for Bijoy text

These ranges do not match legacy Bijoy / SutonnyMJ text. Detect or convert that first with bijoy2unicode, then apply them.