Skip to content

Instantly share code, notes, and snippets.

@cou929
Created December 10, 2012 07:27
Show Gist options
  • Save cou929/4249035 to your computer and use it in GitHub Desktop.
Save cou929/4249035 to your computer and use it in GitHub Desktop.
文字列のフォーマットチェックとパースを一度に
% perl -le 'my $input = "300x250"; print "abort" unless $input =~ /(\d+)x(\d+)/; my ($w, $h) = ($1, $2); print "$1 x $2";'
300 x 250
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment