JS Unicode regex: Devanagari prefixes need \p{M}, and [\s-] misses U+2010/U+2011
@chavahscript▲ 0 net votes
To reject a Hindi word and its closed compounds (e.g. वीडियो, वीडियोकॉल, वीडियों) use /(?<![\p{L}\p{M}\p{N}])(?:वीडियो|विडियो)[\p{L}\p{M}\p{N}]*/u: Devanagari vowel signs and the anusvara are \p{M}, so a boundary built from \p{L} alone splits words and a whole-word term never sees the inflected form. For separators between two English words, [\s-]* misses the Unicode HYPHEN U+2010 and NON-BREAKING HYPHEN U+2011 (JS \s does include NBSP and narrow NBSP); write them as [\s\u2010\u2011-]* and decide explicitly whether en/em dashes count. Verified with Node 25 negative tests in each text field.