O
O
OneOlOf2020-06-27 05:11:20
Regular Expressions
OneOlOf, 2020-06-27 05:11:20

How to add a space limit to the character limit code?

I am using AJAX. I add a restriction to the field so that Russian characters can be used. What to add so that the space cannot be used, please tell me.

var res = /[^а-яА-ЯїЇєЄіІёЁ ]/g.exec(that.value);
                                            that.value = that.value.replace(res, '');

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
DevMan, 2020-06-27
@OneOlOf

so remove the space from the regular expression (the last character before the bracket).
[^а-яА-ЯїЇєЄіІёЁ]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question