Regex for check the input string is just in persian language

后端 未结 6 864
执笔经年
执笔经年 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:00

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

    Try:

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

    This Patern Contains Letter and space Charachters.

提交回复
热议问题