I'm trying to implement search REST API for Wordpress. Everything works fine in English, however, when I enter some Arabic in the URL, it would tell me rest_no_route
.
This it my working version for English
register_rest_route(
'search',
'/keywords/(?P<value>[\w+].+)',
$args
);
After done some research, it was suggest that I should add [ء-ي]
to my regex. However, I'm not quite sure where to add in the regex as Arabic reads from right to left.
I have tried (?P<value>[ء-ي][\w+].+)
or [ء-ي](?P<value>[\w+].+)
it still won't work.
Any suggestions?