Fix by naruse-2

Re-created pull request from https://github.com/os97673/regexp_m17n/pull/24.
Closed pull requests won't be updated even if I update the related branch.

This is based on 8ebb3282ffc37fc462150bb60ace8c017656f2da with more comment.