Regex for check the input string is just in persian language

后端 未结 6 863
执笔经年
执笔经年 2020-12-02 15:27

I work with MVC and I am new on it. I want to check input values is only in Persian language (Characters) by [RegularExpression] Validation. So I think to use

6条回答
  •  无人及你
    2020-12-02 16:02

    Persian characters are within the range: [\u0600-\u06FF]

    Try:

    Regex.IsMatch(value, @"^[\u0600-\u06FF]+$")
    

提交回复
热议问题