3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "<!-- static comment--> <a href='/dir1/dir2/DYNAMIC'> STRING1 STRING2 </a>"; $pattern ="#<a.*?>\s*\n*.*?(\w+)\s*\n*.*?(\w+)#s"; preg_match($pattern, $string, $match); var_dump($match);

preferences:
37.82 ms | 402 KiB | 5 Q