Dedicated Regular Expression for Persian alphabet [duplicate]

Persian characters are within the Arabic Unicode block, which ranges from U+0600 to U+06FF (which is specified in character class as \u0600-\u06FF).

function just_persian(str){
    var p = /^[\u0600-\u06FF\s]+$/;

    if (!p.test(str)) {
        alert("not format");
    }
}

Adapted to JavaScript from this question: Regex for check the input string is just in persian language

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)