#!
while read -r line; do
# Extremely long regex for validating RFC 3339 timestamps
# Blame the POSIX ERE specification for the [0-9]s.
timestamp=$(echo "$line" | grep -Eo '[0-9]{4}-[01][0-9]-[0-3][0-9][Tt][0-2][0-9]:[0-5][0-9]:[0-5][0-9](\.[0-9]+)?([+-][0-2][0-9]:[0-5][0-9]|Zz)')
# Twts need to be sanitizied for pp. I think I have a sed command for that somewhere.
twt=$(echo "$line" | cut -d ' ' -f 2- -)
# This sed command is awful, but it has to be that way because POSIX sed only supports BREs
hyperlinked=$(echo "$twt" | sed 's|http://[^ ]*|&|g; s|https://[^ ]*|&|g')
#!
-
${timestamp}
${hyperlinked}
#!
done
#!