PHP4 (48 chars)
Given $argv[1] as a command line argument :
echo preg_replace('#(.)(.)\b#','2ドル1ドル',$argv[1]);
PHP7.4 (48 chars)
The function $f is inverting the last two chars of every word :
$f=fn($s)=>preg_replace('#(.)(.)\b#','2ドル1ドル',$s);
Try it Online Try it Online - Usage :
echo $f('Flippign Lettesr Aroudn');
Both versions are using 🐘's PCRE Text Processing Functions.
Info: Support for PHP4 has been discontinued since 2008 but same code still works in PHP8.1.
Mathematica (58 chars)
f=StringReplace[#,RegularExpression["(.)(.)\\b"]:>"2ドル1ドル"]&
PHP4 (48 chars)
Given $argv[1] as a command line argument :
echo preg_replace('#(.)(.)\b#','2ドル1ドル',$argv[1]);
PHP7.4 (48 chars)
The function $f is inverting the last two chars of every word :
$f=fn($s)=>preg_replace('#(.)(.)\b#','2ドル1ドル',$s);
Try it Online - Usage :
echo $f('Flippign Lettesr Aroudn');
Both versions are using 🐘's PCRE Text Processing Functions.
Info: Support for PHP4 has been discontinued since 2008 but same code still works in PHP8.1.
Mathematica (58 chars)
f=StringReplace[#,RegularExpression["(.)(.)\\b"]:>"2ドル1ドル"]&
PHP4 (48 chars)
Given $argv[1] as a command line argument :
echo preg_replace('#(.)(.)\b#','2ドル1ドル',$argv[1]);
PHP7.4 (48 chars)
The function $f is inverting the last two chars of every word :
$f=fn($s)=>preg_replace('#(.)(.)\b#','2ドル1ドル',$s);
Try it Online - Usage :
echo $f('Flippign Lettesr Aroudn');
Both versions are using 🐘's PCRE Text Processing Functions.
Info: Support for PHP4 has been discontinued since 2008 but same code still works in PHP8.1.
Mathematica (58 chars)
f=StringReplace[#,RegularExpression["(.)(.)\\b"]:>"2ドル1ドル"]&
PHP4 (48 chars)
Given $argv[1] as a command line argument :
echo preg_replace('#(.)(.)\b#','2ドル1ドル',$argv[1]);
PHP7.4 (48 chars)
The function $f is inverting the last two chars of every word :
$f=fn($s)=>preg_replace('#(.)(.)\b#','2ドル1ドル',$s);
Try it Online Try it Online - Usage :
echo $f('Flippign Lettesr Aroudn');
Both versions are using 🐘's PCRE Text Processing Functions.
Info: Support for PHP4 has been discontinued since 2008 but same code still works in PHP8.1.
Mathematica (58 chars)
f=StringReplace[#,RegularExpression["(.)(.)\\b"]:>"2ドル1ドル"]&
PHP4 (48 chars)
Given $argv[1] as a command line argument :
echo preg_replace('#(.)(.)\b#','2ドル1ドル',$argv[1]);
PHP7.4 (48 chars)
The function $f is inverting the last two chars of every word :
$f=fn($s)=>preg_replace('#(.)(.)\b#','2ドル1ドル',$s);
Try it Online - Usage :
echo $f('Flippign Lettesr Aroudn');
Both versions are using 🐘's PCRE Text Processing Functions.
Info: Support for PHP4 has been discontinued since 2008 but same code still works in PHP8.1.
Mathematica (58 chars)
f=StringReplace[#,RegularExpression["(.)(.)\\b"]:>"2ドル1ドル"]&
PHP4 (48 chars)
Given $argv[1] as a command line argument :
echo preg_replace('#(.)(.)\b#','2ドル1ドル',$argv[1]);
PHP7.4 (48 chars)
The function $f is inverting the last two chars of every word :
$f=fn($s)=>preg_replace('#(.)(.)\b#','2ドル1ドル',$s);
Try it Online - Usage :
echo $f('Flippign Lettesr Aroudn');
Both versions are using 🐘's PCRE Text Processing Functions.
Info: Support for PHP4 has been discontinued since 2008 but same code still works in PHP8.1.
Mathematica (58 chars)
f=StringReplace[#,RegularExpression["(.)(.)\\b"]:>"2ドル1ドル"]&
PHP4 (5148 chars)
Given $argv[1] as a command line argument :
echo preg_replace('#(.)(.) #'\b#','2ドル1ドル ''2ドル1ドル',"$argv[1] "$argv[1]);
PHP7.4 (5148 chars)
The function $f is inverting the last two chars of every word :
$f=fn($s)=>preg_replace('#(.)(.) #'\b#','2ドル1ドル ''2ドル1ドル',"$s "$s);
Try it Online - Usage :
echo $f('Flippign Lettesr Aroudn');
Both versions are using 🐘's PCRE Text Processing Functions.
Info: Support for PHP4 has been discontinued since 2008 but same code still works in PHP8.1.
Mathematica (6158 chars)
f=StringReplace[#,RegularExpression["(.)(.)($| )"]\\b"]:>"2ドル1ドル "]&>"2ドル1ドル"]&
sed (26 chars)
The stream editor is reading from it's standard input.Try it online
sed -E 's/(.)(.)\b/2円1円/g'
PHP4 (51 chars)
Given $argv[1] as a command line argument :
echo preg_replace('#(.)(.) #','2ドル1ドル ',"$argv[1] ");
PHP7.4 (51 chars)
The function $f is inverting the last two chars of every word :
$f=fn($s)=>preg_replace('#(.)(.) #','2ドル1ドル ',"$s ");
Try it Online - Usage :
echo $f('Flippign Lettesr Aroudn');
Both versions are using 🐘's PCRE Text Processing Functions.
Info: Support for PHP4 has been discontinued since 2008 but same code still works in PHP8.1.
Mathematica (61 chars)
f=StringReplace[#,RegularExpression["(.)(.)($| )"]:>"2ドル1ドル "]&
sed (26 chars)
The stream editor is reading from it's standard input.
sed -E 's/(.)(.)\b/2円1円/g'
PHP4 (48 chars)
Given $argv[1] as a command line argument :
echo preg_replace('#(.)(.)\b#','2ドル1ドル',$argv[1]);
PHP7.4 (48 chars)
The function $f is inverting the last two chars of every word :
$f=fn($s)=>preg_replace('#(.)(.)\b#','2ドル1ドル',$s);
Try it Online - Usage :
echo $f('Flippign Lettesr Aroudn');
Both versions are using 🐘's PCRE Text Processing Functions.
Info: Support for PHP4 has been discontinued since 2008 but same code still works in PHP8.1.
Mathematica (58 chars)
f=StringReplace[#,RegularExpression["(.)(.)\\b"]:>"2ドル1ドル"]&