我正在寻求实现此答案中提供的解决方案,但它无法正常工作.这个jsFiddle中的代码看起来像这样:
function Start() {
$('#TheBox').keyup(function () {
var TheInput = $('#TheBox').val();
var TheCleanInput = TheInput.replace(/([.\p{L}])/g, '');
$('#TheBox').val(TheCleanInput);
});
}
$(Start);
Run Code Online (Sandbox Code Playgroud)
基本上,我希望允许使用诸如éèô和数字之类的字母.我需要更改什么才能使正则表达式过滤器工作?
谢谢.