I am a bit confused by preg_replace as I have not used regex before. I did a bit of searching and couldn't find anything that worked for my situation.
I have logs that contain connections made to the server, like this:
Username connected, address "123.123.123.123:1234"
I want preg_replace to look for this part:
address "123.123.123.123:1234"
And change it to this:
address "snip"
Basically snipping the IP address out, so these logs can be published publicly on the website.
Here's what I currently have that I was testing with.
$new_log = preg_replace('/\address\s"(.*)"/', '', $old_log);
I just need help getting the regex correct.