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);

preferences:
105.82 ms | 2329 KiB | 5 Q