1
4

2 回答 2

2

Javascript regular expressions don't support unicode properties. You have to add explicit unicode ranges to your expression. For example, the range for Georgian is 10A0-10FF, so to replace everything that is not a Latin or Georgian character, you need something like

val.replace(/[^\w\u10A0-\u10FF]/g, '')

This tool can help you further.

于 2012-12-23T13:20:52.203 回答
1

You can specify allowed characters ranges manually, or you can use some library like XRegExp.

于 2012-12-23T13:22:40.757 回答