Update
I found a bug in the code which caused the letters after غ not to be matched.
After some researches, I found that there are two ranges of characters… From أ to غ and from ف to ي.
http://www.unicodemap.org/range/12/Arabic/
So I added both ranges and adjusted the code to be as below:
add_rewrite_rule(
'(mycategory/)([أ-غa-zف-ي]+)/?$','index.php?category_name=$matches[1]&letter=$matches[2]','top'
);
Note that I added a-z in the middle just to split the letters, however, the following code is also working properly.
add_rewrite_rule(
'(mycategory/)([أ-غف-ي]+)/?$','index.php?category_name=$matches[1]&letter=$matches[2]','top'
);
Resolved using the following:
add_rewrite_rule(
'(stars-a-z/)([أ-ي]+)/?$','index.php?category_name=$matches[1]&letter=$matches[2]','top'
);