BaseMax/FilterInputJs

FeedBack: Restrict allowed languages!

BaseMax opened this issue · 5 comments

Hey everyone,

In this issue, we want to check the UTF-8 for different language.

Goal

You can request a language, or discuss UTF-8... (regex)

What's "data-filter-lang"?

An argument to restrict the allowed languages.

Regards,
Max

Persian

Arabic alphabet + ژ + چ

ا ب پ ت ث ج چ ح خ د ذ ر ز ژ س ش ص ض ط ظ ع غ ف ق ک گ ل م ن و ه ی

۰۱۲۳۴۵۶۷۸۹

http://www.fileformat.info/info/unicode/block/arabic/list.htm
https://en.wikipedia.org/wiki/Persian_alphabet

e.g:

function justPersian(input){
    var format = /^[\u0600-\u06FF\s]+$/;
    if (!format.test(input)) {
        alert("Error!");
    }
}

Arabic

ا ب پ ت ث ج ح خ د ذ ر ز س ش ص ض ط ظ ع غ ف ق ک گ ل م ن و ه ی

٠١٢٣٤٥٦٧٨٩

http://www.fileformat.info/info/unicode/block/arabic/list.htm
https://en.wikipedia.org/wiki/Arabic_alphabet

e.g:

function justArabic(input){
    var format = /^[\u0600-\u06FF\s]+$/;
    if (!format.test(input)) {
        alert("Error!");
    }
}

English

A a B b C c D d E e F f G g H h I i J j K k L l M m N n O o P p Q q R r S s T t U u V v W w X x Y y Z z

0123456789

https://en.wikipedia.org/wiki/English_alphabet

e.g:

function justEnglish(input){
    // var format = /^[a-zA-Z0-9\s]+$/;
    var format = /^[a-zA-Z\s]+$/;
    if (!format.test(input)) {
        alert("Error!");
    }
}
krthr commented

Hey, Which languages ​​do we use?

Hey, Which languages ​​do we use?

At first, we focus to complete the filter's items.
Next, we can work on this issue. (At the first: English)