Add brackets to timestamp when copying if hidden
Add brackets around timestamp if ShowSenderBrackets is disabled -and-
the timestamp format does not contain brackets. This matches all
common types of brackets using a regular expression.
Remove any leading and trailing space from timestamp format before
copying if above conditions met, to avoid having [ 11:04:32] or some
such. This might be unexpected, but if someone has specific needs
for the bracket arrangement, they can toggle to always show sender
brackets.
Examples with show sender brackets disabled:
" hh:mm:ss" -> "[hh:mm:ss]"
" h:mm:ss ap" -> "[h:mm:ss ap]"
"<hh mm ss" -> "[<hh mm ss]"
"[hh:mm:ss]" -> unchanged
"<hh mm ss>" -> unchanged
"{hh:mm:ss:ss>" -> unchanged (and I won't ask why you're doing this)
For regular expression debugging and explanations,
See: https://regex101.com/