perl いろいろな正規表現1
#入力された英文を単語ごとに区切り、「単語:区切られた単語」のように表示するスクリプト $ward = <STDIN>; chomp($ward); print "単語:$&\n" while($ward =~ /\w+/g); #実行結果 #There's more than one way to do it # There's more than one way to do it # 単語:There # 単語:s # 単語:more # 単語:than # 単語:one # 単語:way # 単語:to # 単語:do # 単語:it
- 作者: Randal L. Schwartz,brian d foy,Tom Phoenix,近藤嘉雪
- 出版社/メーカー: オライリージャパン
- 発売日: 2012/07/25
- メディア: 大型本
- 購入: 7人 クリック: 22回
- この商品を含むブログ (17件) を見る