2007-11-19から1日間の記事一覧
練習問題の回答をメモ。正規表現って奥が深そう。 ex08-1 #!/usr/bin/perl use strict; while (<>) { chomp; # 正しくは:/\b(fred|wilma)\s+flintstone\b/ if (/(fred|wilma)\s+flintstone/) { print "Matched: $`<$&>$'\n"; } else { print "No match.\n";…
練習問題の回答をメモ。正規表現って奥が深そう。 ex08-1 #!/usr/bin/perl use strict; while (<>) { chomp; # 正しくは:/\b(fred|wilma)\s+flintstone\b/ if (/(fred|wilma)\s+flintstone/) { print "Matched: $`<$&>$'\n"; } else { print "No match.\n";…