Music: OFF Type regular expression which matches zombie's name and kill them. Don't kill humans. Regular Expression: . match any charactor ^ top of strings $ end of strings [] charactor set * repeat + repeat
Take a look at this Perl regular expression: perl -lne '(1x$_) =~ /^(11+?)\1+$/ && print "$_ is composite"' This regular expression matches only the composite numbers (and doesn't match prime numbers). Can you figure out how it works? I'll give the explanation below but try to figure it out yourself. Here is what happens when you run it: $ perl -lne '(1x$_) =~ /^(11+?)\1+$/ && print "$_ is composi
複数の正規表現式で文字列からトークンを切り出したいことがある。しかし、以下のコードは動かない。無限ループになってしまう。 #!perl -w # THIS DOES NOT WORK!!! use 5.10.0; use strict; use utf8; my $s = 'foo bar baz FOO BAR BAZ'; while( 1 ) { if( $s =~ /\b (f..) \b/xmsig) { # first matching expression say $1; } elsif( $s =~ /\b (b..) \b/xmsig) { # second matching expression say $1; } else { die 'finished'; } } これは[twitter:@akajiro]さんと[twitter:@hio]さんに教えてもらった結果、解
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く