remove Niqqud from string in javascript

后端 未结 1 1445
一生所求
一生所求 2021-01-22 03:38

I have the exact problem described here:

removing Hebrew "niqqud" using r

Have been struggling to remove niqqud ( diacritical signs used to

1条回答
  •  -上瘾入骨i
    2021-01-22 04:12

    Just a slight problem with your regex. Try the following:

    const input = "הֻסְמַק";
    console.log(input)
    console.log(input.replace(/[\u0591-\u05C7]/g, ''));
    
    /*
    $ node index.js
    הֻסְמַק
    הסמק
    */
    

    0 讨论(0)
提交回复
热议问题