3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $message = " [xxxStudent.address_1xxx][xxxStudent.address_2xxx][xxxStudent.address_3xxx] [xxxStudent.townxxx] [xxxStudent.countyxxx] [xxxStudent.postcodexxx] [xxxStudent.country_iso_2xxx]"; preg_match_all('/\[xxx(\w+[\.+\w+]+)xxx\]/', $message, $tags, PREG_SET_ORDER); var_dump($tags);
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
array(7) { [0]=> array(2) { [0]=> string(25) "[xxxStudent.address_1xxx]" [1]=> string(17) "Student.address_1" } [1]=> array(2) { [0]=> string(25) "[xxxStudent.address_2xxx]" [1]=> string(17) "Student.address_2" } [2]=> array(2) { [0]=> string(25) "[xxxStudent.address_3xxx]" [1]=> string(17) "Student.address_3" } [3]=> array(2) { [0]=> string(20) "[xxxStudent.townxxx]" [1]=> string(12) "Student.town" } [4]=> array(2) { [0]=> string(22) "[xxxStudent.countyxxx]" [1]=> string(14) "Student.county" } [5]=> array(2) { [0]=> string(24) "[xxxStudent.postcodexxx]" [1]=> string(16) "Student.postcode" } [6]=> array(2) { [0]=> string(29) "[xxxStudent.country_iso_2xxx]" [1]=> string(21) "Student.country_iso_2" } }