パンくず
書籍 Regular Expressions Cookbook
Find Similar Words
概要
似た単語のマッチングについて
サンプル
print "ユーザー ユーザ".scan(/\bユーザー?\b/) puts "" print "hage hige hoge".scan(/\bh[aio]ge?\b/) puts "" print "ベジータ セニョリータ マルガリータ".scan(/\b.*ータ\b/)
出力
["ユーザー", "ユーザ"] ["hage", "hige", "hoge"] ["ベジータ セニョリータ マルガリータ"]