LoginSignup
74

More than 5 years have passed since last update.

rubyで平仮名、カタカナの正規表現マッチをする方法

Last updated at Posted at 2012-12-26

rubyは正規表現エンジンに鬼車( https://github.com/kkos/oniguruma )を採用しているので、鬼車の機能をつかって用意に平仮名、カタカナのマッチングを取れる

# 平仮名
/\p{hiragana}/
# カタカナ
/\p{katakana}/

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
74