#Bash 74 Sed 65 + 4 bytes
Bash 74 Sed 65 + 4 bytes
65 bytes for the script and 4 for the r
and f
flags.
sed -r "s/\s*([.,?\!\"\':;\(\)A-Z])(\1|\s)*/\1/g;s/(he|she|it) is/\1\'s/i"
s/\s*([,.?\!\"\':;\(\)A-Z])(\1|\s)*/\1/g;s/(he|she|it) is/\1\'s/i
Usage: Enter text, press enter and then Ctrl + D (send EOF).