Validate Unicode Length With Regex
c#, regex
Solution
You can use the following regular expression:
"^[\u06F0-\u06F9]{4}/[\u06F0-\u06F9]{2}/[\u06F0-\u06F9]{2}$"
You're probably missing the `^` to make it start the match at the beginning of the string and the `$` to make it end the match at the end of the string. Without these changes strings that were longer, but that contained your expression would yield as a match.
With this change a match is only successful if the string contains your pattern and does not have any extra characters to the left or to the right of the target pattern.
Problem
How can I validate ۱۳۹۱/۰۹/۰۹ string with Regex I want the length of each separate slash be exact as {4}/{2}/{2} the Unicode range is [\u06F0-\u06F9]. I have problem with length checking.