add unicode support for `~\R~` pattern

fixes `~\R~` preg replace support for all unicode characters through other languages.

Signed-off-by: Richard Lea <chigix@zoho.com>