3v4l.org

run code in 300+ PHP versions simultaneously
1<?php $str = '<Location "/wtf" "yo" \'hello\'> Allow from all </Location>'; preg_match('/(<[\S\s]+?>)([\S\s]+?)<\/[A-Za-z]+>/', $str, $matches); var_dump($matches); $res = trim($matches[1], "<>"); $content = $matches[2]; preg_match_all( '/"[^"\\\\]*(?:\\\\.[^"\\\\]*)*"|\'[^\'\\\\]*(?:\\\\.[^\'\\\\]*)*\'|\S+/', $res , $matches ); var_dump($matches);

preferences:
39.67 ms | 402 KiB | 5 Q