Tbpgr Blog

Employee Experience Engineer tbpgr(てぃーびー) のブログ

2012-06-04から1日間の記事一覧

書籍 Regular Expressions Cookbook | Find All Except a Specific Word

パンくず 書籍 Regular Expressions Cookbook Find All Except a Specific Word 概要 特定の単語を除く単語のマッチングについて サンプル print "dog cat tiger catfish".scan(/\b(?!cat\b)\w+/) 出力 ["dog", "tiger", "catfish"]

書籍 Regular Expressions Cookbook | Find Similar Words

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

書籍 Regular Expressions Cookbook | Find a Specific Word

パンくず 書籍 Regular Expressions Cookbook Find a Specific Word 概要 単語のマッチングについて 構文 /bword/b サンプル puts "My name is hoge.Your name is hoge too.".scan(/\bhoge\b/) 出力 hoge hoge