3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "001122334 001122334455 0011 0011223344556677"; if (preg_match_all('/\b[a-fA-F0-9]{12}\b/', $string, $matches)) { print_r($matches[0]); } if (preg_match_all('/(?<!\S)[a-fA-F0-9]{12}(?!\S)/', $string, $matches)) { print_r($matches[0]); } if (preg_match_all('/(?<![a-fA-F0-9])[a-fA-F0-9]{12}(?![a-fA-F0-9])/', $string, $matches)) { print_r($matches[0]); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 11
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 21
Branch analysis from position: 17
2 jumps found. (Code = 43) Position 1 = 27, Position 2 = 31
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 31
Branch analysis from position: 21
Branch analysis from position: 11
filename:       /in/cjmWV
function name:  (null)
number of ops:  32
compiled vars:  !0 = $string, !1 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '001122334+001122334455+0011+0011223344556677'
    4     1        INIT_FCALL                                               'preg_match_all'
          2        SEND_VAL                                                 '%2F%5Cb%5Ba-fA-F0-9%5D%7B12%7D%5Cb%2F'
          3        SEND_VAR                                                 !0
          4        SEND_REF                                                 !1
          5        DO_ICALL                                         $3      
          6      > JMPZ                                                     $3, ->11
    5     7    >   INIT_FCALL                                               'print_r'
          8        FETCH_DIM_R                                      ~4      !1, 0
          9        SEND_VAL                                                 ~4
         10        DO_ICALL                                                 
    7    11    >   INIT_FCALL                                               'preg_match_all'
         12        SEND_VAL                                                 '%2F%28%3F%3C%21%5CS%29%5Ba-fA-F0-9%5D%7B12%7D%28%3F%21%5CS%29%2F'
         13        SEND_VAR                                                 !0
         14        SEND_REF                                                 !1
         15        DO_ICALL                                         $6      
         16      > JMPZ                                                     $6, ->21
    8    17    >   INIT_FCALL                                               'print_r'
         18        FETCH_DIM_R                                      ~7      !1, 0
         19        SEND_VAL                                                 ~7
         20        DO_ICALL                                                 
   10    21    >   INIT_FCALL                                               'preg_match_all'
         22        SEND_VAL                                                 '%2F%28%3F%3C%21%5Ba-fA-F0-9%5D%29%5Ba-fA-F0-9%5D%7B12%7D%28%3F%21%5Ba-fA-F0-9%5D%29%2F'
         23        SEND_VAR                                                 !0
         24        SEND_REF                                                 !1
         25        DO_ICALL                                         $9      
         26      > JMPZ                                                     $9, ->31
   11    27    >   INIT_FCALL                                               'print_r'
         28        FETCH_DIM_R                                      ~10     !1, 0
         29        SEND_VAL                                                 ~10
         30        DO_ICALL                                                 
   12    31    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
137.54 ms | 1000 KiB | 15 Q