素数にマッチする正規表現だと!?なにこれ簡単なようで分からん。

tmatsuutmatsuu のブックマーク 2011/12/26 22:16

その他

このブックマークにはスターがありません。
最初のスターをつけてみよう!

A Perl regex that matches composite numbers (and doesn't match prime numbers)

    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 numbe...

    \ コメントが サクサク読める アプリです /

    • App Storeからダウンロード
    • Google Playで手に入れよう