3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $string = "username............: username home directory......: 00/username mail storage server.: mail-server.example.net status..............: active quota size..........: 1000.000 megabytes quota count.........: no quota forward to..........: username@example.com full name...........: testing:testing offers..............:"; preg_match_all('/\s*(?<key>[^a-z ]+)\.*:\s*(?<value>.+)\s*/i', $string, $matches); var_dump($matches);
Output for 4.4.6 - 4.4.9, 5.2.2 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
array(5) { [0]=> array(8) { [0]=> string(23) "............: username " [1]=> string(20) "......: 00/username " [2]=> string(27) ".: mail-server.example.net " [3]=> string(23) "..............: active " [4]=> string(31) "..........: 1000.000 megabytes " [5]=> string(20) ".........: no quota " [6]=> string(33) "..........: username@example.com " [7]=> string(29) "...........: testing:testing " } ["key"]=> array(8) { [0]=> string(12) "............" [1]=> string(6) "......" [2]=> string(1) "." [3]=> string(14) ".............." [4]=> string(10) ".........." [5]=> string(9) "........." [6]=> string(10) ".........." [7]=> string(11) "..........." } [1]=> array(8) { [0]=> string(12) "............" [1]=> string(6) "......" [2]=> string(1) "." [3]=> string(14) ".............." [4]=> string(10) ".........." [5]=> string(9) "........." [6]=> string(10) ".........." [7]=> string(11) "..........." } ["value"]=> array(8) { [0]=> string(8) "username" [1]=> string(11) "00/username" [2]=> string(23) "mail-server.example.net" [3]=> string(6) "active" [4]=> string(18) "1000.000 megabytes" [5]=> string(8) "no quota" [6]=> string(20) "username@example.com" [7]=> string(15) "testing:testing" } [2]=> array(8) { [0]=> string(8) "username" [1]=> string(11) "00/username" [2]=> string(23) "mail-server.example.net" [3]=> string(6) "active" [4]=> string(18) "1000.000 megabytes" [5]=> string(8) "no quota" [6]=> string(20) "username@example.com" [7]=> string(15) "testing:testing" } }
Output for 5.2.0 - 5.2.1
Warning: preg_match_all(): Compilation failed: unrecognized character after (?< at offset 6 in /in/M05sU on line 13 NULL
Output for 4.3.11 - 4.4.5, 5.0.0 - 5.1.6
Warning: preg_match_all(): Compilation failed: unrecognized character after (?< at offset 6 in /in/M05sU on line 13 array(0) { }
Output for 4.3.0 - 4.3.10
Warning: Compilation failed: unrecognized character after (?< at offset 6 in /in/M05sU on line 13 array(0) { }