Which is basically halfway optimised.
I still keep matching the exact pattern of the date, except that I declare the content to be completely optional.
As this could potentially result in a valid match when the first dot matches the closing bracket, I replaced the first dot by a "not ]" expression.
This also yield faster speeds as the optional pattern immediately fails at the first character and can then is forced to try to not match the optional part.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Three days later or something I discovered that fail2ban is stripping out the date entirely.
Ended up using the following:
Which is basically halfway optimised.
I still keep matching the exact pattern of the date, except that I declare the content to be completely optional.
As this could potentially result in a valid match when the first dot matches the closing bracket, I replaced the first dot by a "not ]" expression.
This also yield faster speeds as the optional pattern immediately fails at the first character and can then is forced to try to not match the optional part.