ForNext
Only Do What Only You Can Do
075. scan
Hyperpolyglot Interpreted Languages: PHP, Perl, Python, Ruby より (2012.05.08)
VBScript
JScript
Perl
my $s = "dolor sit amet"; @a = $s =~ m/\w+/g;
PHP
$s = "dolor sit amet"; preg_match_all('/\w+/', $s, $m); $a = $m[0];
Python
s = 'dolor sit amet' a = re.findall('\w+', s)
Ruby
a = "dolor sit amet".scan(/\w+/)