3v4l.org

run code in 300+ PHP versions simultaneously
<?php $subject = "FH_189.90.192.12 2016-02-02 21:03:05 M CTAG COMPLD total_blocks=1 block_number=1 block_records=13 list of ONU state -------------------------------------------------------------------------------- ONUID AdminState OperState AUTH AUTHINFO ONUIP LASTOFFTIME 4 UP UP MAC c0-7e-40-48-4f-30 -- 2016-01-29 08:53:35 6 UP UP MAC c0-7e-40-48-4f-6f -- 2016-01-29 08:53:35 5 UP LOS MAC c0-7e-40-48-64-20 -- 2016-01-31 21:17:56 8 UP LOS MAC c0-7e-40-48-4f-5e -- 2015-10-01 10:21:55 9 UP UP MAC c0-7e-40-48-62-ce -- 2016-01-29 08:53:35 10 UP UP MAC c0-7e-40-48-4f-69 -- 2016-01-29 08:53:34 11 UP UP MAC c0-7e-40-48-4f-4d -- 2016-02-01 17:53:57 12 UP UP MAC c0-7e-40-48-4f-33 -- 2015-11-23 19:40:14 13 UP LOS MAC c0-7e-40-48-4f-7d -- 2015-10-01 10:22:05 14 UP UP MAC c0-7e-40-48-4f-28 -- 2016-01-29 08:53:34 15 UP UP MAC c0-7e-40-48-4f-e5 -- 2016-01-29 08:53:33 16 UP UP MAC c0-7e-40-48-4f-af -- 2016-01-29 08:53:34 17 UP UP MAC c0-7e-40-48-4f-91 -- 2015-10-01 10:22:13 -------------------------------------------------------------------------------- ;"; $pattern = "/\d{1,}\s(UP)\s(UP|LOS)\s(MAC)\s\w{2}-\w{2}-\w{2}-\w{2}-\w{2}-\w{2}\s--\s\w{4}-\w{2}-\w{2}\s\d{2}:\d{2}:\d{2}/"; preg_match($pattern, $subject, $matches); print_r($matches);

preferences:
55.82 ms | 402 KiB | 5 Q