3v4l.org

run code in 500+ PHP versions simultaneously
<?php $string = "[[some_non-matching_text]] [[https://example.com|link]] [[this is not matching either]] [[http://example2.com|link2]]"; echo preg_replace('~\[\[((?:(?!\[\[).)*?)\|(.*?)]]~s', '<a href="$1">$2</a>', $string);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YJ2eQ
function name:  (null)
number of ops:  5
compiled vars:  !0 = $string
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, '%5B%5Bsome_non-matching_text%5D%5D+%5B%5Bhttps%3A%2F%2Fexample.com%7Clink%5D%5D+%5B%5Bthis+is+not+matching+either%5D%5D+%5B%5Bhttp%3A%2F%2Fexample2.com%7Clink2%5D%5D'
    4     1        FRAMELESS_ICALL_3                preg_replace        ~2      '%7E%5C%5B%5C%5B%28%28%3F%3A%28%3F%21%5C%5B%5C%5B%29.%29%2A%3F%29%5C%7C%28.%2A%3F%29%5D%5D%7Es', '%3Ca+href%3D%22%241%22%3E%242%3C%2Fa%3E'
          2        OP_DATA                                                      !0
          3        ECHO                                                         ~2
          4      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
157.25 ms | 2127 KiB | 13 Q