2000-06-02 単語にマッチさせる ruby pattern p 'Seventh Avenue/Adam Clayton Powell Jr. Boulevard'.scan(/\w+/) #=> [["Seventh"], ["Avenue"], ["Adam"], ["Clayton"], ["Powell"], ["Jr"], ["Boulevard"]] '単語'という概念がアプリによって変わるので,単語とは何か?によって当然,正規表現も変わる.\b自体は/\Afile\b/のような感じで,'file'と'file_something'で前者のみが欲しい場合に使う.