I'm currently trying to filter out any bad char from a string to only allow alphanumeric ones but I need to include Chinese, Japanese and all that non-Latin languages as well. After some hours of reading RegEx, I'm more confused than informed. Currently I have:
let string = 'Test=查看 ' +
'';
string = string.replace(/[^A-Za-z\d\p{Han}]+$/ug,' ');
console.log(string);
Without the {Han} everything works well, but no Chinese chars. Any idea? I want to keep it simple, but this seems to be impossible.