3v4l.org

run code in 500+ PHP versions simultaneously
<?php $strings = [ "https://www.instagram.com/p/BxKRx5CHn5i/", "https://www.instagram.com/p/BrODg5XHlE6/?utm_source=ig_share_sheet&igshid=znsinsart176", "https://www.instagram.com/p/BxKRx5CHn5i/", "https://www.instagram.com/username/p/BxE5PpZhoa9/", "https://www.instagram.com/username/p/BxE5PpZhoa9/#look=overhere" ]; foreach ($strings as $string) { echo preg_match('~(?:https?://)?(?:www\.)?instagram\.com(?:/[^/]+)*/\K\w+~', $string , $m) ? $m[0] : ''; echo " (from $string)\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 19
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 19
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 12
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/aL2R7
function name:  (null)
number of ops:  21
compiled vars:  !0 = $strings, !1 = $string, !2 = $m
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                       !0, <array>
   10     1      > FE_RESET_R                                           $4      !0, ->19
          2    > > FE_FETCH_R                                                   $4, !1, ->19
   11     3    >   INIT_FCALL                                                   'preg_match'
          4        SEND_VAL                                                     '%7E%28%3F%3Ahttps%3F%3A%2F%2F%29%3F%28%3F%3Awww%5C.%29%3Finstagram%5C.com%28%3F%3A%2F%5B%5E%2F%5D%2B%29%2A%2F%5CK%5Cw%2B%7E'
          5        SEND_VAR                                                     !1
          6        SEND_REF                                                     !2
          7        DO_ICALL                                             $5      
          8      > JMPZ                                                         $5, ->12
          9    >   FETCH_DIM_R                                          ~6      !2, 0
         10        QM_ASSIGN                                            ~7      ~6
         11      > JMP                                                          ->13
         12    >   QM_ASSIGN                                            ~7      ''
         13    >   ECHO                                                         ~7
   12    14        ROPE_INIT                                         3  ~9      '+%28from+'
         15        ROPE_ADD                                          1  ~9      ~9, !1
         16        ROPE_END                                          2  ~8      ~9, '%29%0A'
         17        ECHO                                                         ~8
   10    18      > JMP                                                          ->2
         19    >   FE_FREE                                                      $4
   13    20      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
160.04 ms | 2396 KiB | 15 Q