wouldn't it be feasible to anchor it at the front as well?

With all the ```.*``` in it -- we would need to make sure that there is no other logged line with user input logged at the end of the line.   if we could anchor upfront and replace first ```.*``` with explicit listing of all possible ```alertstring```s -- we should be safe(r)