I'm absolutely terrible at regex; can anyone help me solve the expression I need in order to separate two values I need from a log file?
Log file example.
1/28/2013 8:43:22 PM Removed {178.76.234.41}
1/28/2013 8:43:22 PM Removed {78.105.26.0}
1/28/2013 8:43:22 PM Removed {24.165.198.12}
1/28/2013 8:43:23 PM Added {178.76.234.41}
1/28/2013 8:43:23 PM Added {69.246.227.43}
With my current code I am able to separate the IP address, however I now need both the state (added/removed) and the IP address. Here is my current code.
preg_match_all("/.*{(.*)}.*/", $a, $b);
What do I need to replace "/.{(.)}.*/" with in order to grab both the state and the IP address to store into the array?