A
A
Alexey Lebedev2014-07-26 19:42:00
Character encoding
Alexey Lebedev, 2014-07-26 19:42:00

How to check username for allowed characters?

It used to be like this:
^[a-zA-Zа-яА-Я0-9* _-]{3,50}$
Until people from Armenia, Georgia and Greece appeared.
Well, Greek, I can add:
^[a-zA-Zа-яА-Яα-ωΑ-Ω0-9* _-]{3,50}$
But as for Chinese or Korean, it's not clear what the first character is.
Is it possible to write /ru/ in regular expressions and then you can use any Cyrillic characters?
I use UTF-8 and C# on the server, and JavaScript on the client, validation is needed both there and there.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
G
Grag, 2014-07-26
@Grag

Remove the tags from the input, people from these countries have always been there, I’ll say more if the last name or first name is written with a dash, there will be another trouble. Do not specify allowed, check for what should not be present.
Imagine that you write laws. It is much easier to write where you can not drink alcohol, and more effective than where you can.

A
Alexander Borisovich, 2014-07-26
@Alexufo

Why would you ask like that?
en.wikipedia.org/wiki/%D0%A0%D0%B5%D0%B3%D1%83%D0%...
here
just test)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question