Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Answer

deleted 12 characters in body
Source Link
user111777
user111777

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ドル"]&

Try it online Try it online

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ドル"]&

Try it online

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ドル"]&

Try it online

edited body
Source Link
user111777
user111777

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ドル"]&

Try it online

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ドル"]&

Try it online

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ドル"]&

Try it online

deleted 163 characters in body
Source Link
user111777
user111777

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ドル"]&

Try it online

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ドル "]&

Try it online

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ドル"]&

Try it online

added 103 characters in body
Source Link
user111777
user111777
Loading
deleted 4 characters in body
Source Link
user111777
user111777
Loading
deleted 2 characters in body
Source Link
user111777
user111777
Loading
added 443 characters in body
Source Link
user111777
user111777
Loading
added 33 characters in body
Source Link
user111777
user111777
Loading
[Edit removed during grace period]; added 39 characters in body
Source Link
user111777
user111777
Loading
edited body
Source Link
user111777
user111777
Loading
edited body
Source Link
user111777
user111777
Loading
deleted 25 characters in body
Source Link
user111777
user111777
Loading
deleted 46 characters in body
Source Link
user111777
user111777
Loading
deleted 2 characters in body
Source Link
user111777
user111777
Loading
added 301 characters in body
Source Link
user111777
user111777
Loading
added 230 characters in body
Source Link
user111777
user111777
Loading
Source Link
user111777
user111777
Loading

AltStyle によって変換されたページ (->オリジナル) /