http://qs321.pair.com?node_id=248357


in reply to Can this be a 1 line or simpler regex?

$_ = "one\ttwo\nthree four five\r"; s/(\t)|(\n)|(\r)|(\f)/ ($1 && '\t' || '') . ($2 && '\n' || '') . ($3 && '\r' || '') . ($4 && '\f' || '') /ge;
Update:
$_ = "one\ttwo\nthree four five\r"; s/(\t)|(\n)|(\r)|(\f)/ $1 ? '\t' : $2 ? '\n' : $3 ? '\r' : $4 ? '\f' : '' /ge;

Makeshifts last the longest.