Skip to content

Instantly share code, notes, and snippets.

@kb10uy
Created November 4, 2018 06:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kb10uy/972ebd1b386ad26771edbb8c1057a986 to your computer and use it in GitHub Desktop.
Save kb10uy/972ebd1b386ad26771edbb8c1057a986 to your computer and use it in GitHub Desktop.
stdin に判定したい文字列を流し込む。その文字列に順不同かつ量一致で「ゆゆ式」が含まれていれば成功
use utf8;
binmode(STDIN, ":utf8");
binmode(STDOUT, ":utf8");
<STDIN> =~ /(?{$yu=2;$shiki=1})(ゆ(?{$yu--})|式(?{$shiki--})|.)+/;
if ($yu == 0 && $shiki == 0) {
print "ゆゆ式\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment