3v4l.org

run code in 500+ PHP versions simultaneously
<?php $text = <<< TXT @font-face { font-family: 'montserat'; src: url('montserrat-regular-webfont.woff') format('woff'); font-weight: 400; font-style: normal; } @font-face { font-family: 'montserat'; src: url('montserrat-medium-webfont.woff') format('woff'); font-weight: 500; font-style: normal; } @font-face { font-family: 'montserat'; src: url('montserrat-semibold-webfont.woff') format('woff'); font-weight: 600; font-style: normal; } @font-face { font-family: 'montserat'; src: url('montserrat-bold-webfont.woff') format('woff'); font-weight: 700; font-style: normal; } @font-face { font-family: 'montserat'; src: url('montserrat-extrabold-webfont.woff') format('woff'); font-weight: 800; font-style: normal; } TXT; preg_match_all('~(?>@font-face\s*{\s*|\G(?!\A))((?!\/[\/*])\S+)\s*:\s*([^;]+);\s*\K~', $text, $matches, PREG_SET_ORDER); print_r($matches);
Output for 5.6.38 - 5.6.40, 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.34, 8.2.0 - 8.2.30, 8.3.0 - 8.3.30, 8.4.1 - 8.4.21, 8.5.0 - 8.5.6
Array ( [0] => Array ( [0] => [1] => font-family [2] => 'montserat' ) [1] => Array ( [0] => [1] => src [2] => url('montserrat-regular-webfont.woff') format('woff') ) [2] => Array ( [0] => [1] => font-weight [2] => 400 ) [3] => Array ( [0] => [1] => font-style [2] => normal ) [4] => Array ( [0] => [1] => font-family [2] => 'montserat' ) [5] => Array ( [0] => [1] => src [2] => url('montserrat-medium-webfont.woff') format('woff') ) [6] => Array ( [0] => [1] => font-weight [2] => 500 ) [7] => Array ( [0] => [1] => font-style [2] => normal ) [8] => Array ( [0] => [1] => font-family [2] => 'montserat' ) [9] => Array ( [0] => [1] => src [2] => url('montserrat-semibold-webfont.woff') format('woff') ) [10] => Array ( [0] => [1] => font-weight [2] => 600 ) [11] => Array ( [0] => [1] => font-style [2] => normal ) [12] => Array ( [0] => [1] => font-family [2] => 'montserat' ) [13] => Array ( [0] => [1] => src [2] => url('montserrat-bold-webfont.woff') format('woff') ) [14] => Array ( [0] => [1] => font-weight [2] => 700 ) [15] => Array ( [0] => [1] => font-style [2] => normal ) [16] => Array ( [0] => [1] => font-family [2] => 'montserat' ) [17] => Array ( [0] => [1] => src [2] => url('montserrat-extrabold-webfont.woff') format('woff') ) [18] => Array ( [0] => [1] => font-weight [2] => 800 ) [19] => Array ( [0] => [1] => font-style [2] => normal ) )

preferences:
120.25 ms | 2336 KiB | 4 Q