3v4l.org

run code in 300+ PHP versions simultaneously
<?php $re = '/^([^:\n\r]+):(.*(?:\R(?![^:\n\r]+:[^:\n\r]*$).*)*)/m'; $str = 'Name: John Doe Age: 23 Primary Language: English Description: This is a multiline description field that I want to capture Fri, 02 Sep 2022 14:46:45 -0500 Country: Canada'; preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0); print_r($matches);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KiM8S
function name:  (null)
number of ops:  13
compiled vars:  !0 = $re, !1 = $str, !2 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%2F%5E%28%5B%5E%3A%5Cn%5Cr%5D%2B%29%3A%28.%2A%28%3F%3A%5CR%28%3F%21%5B%5E%3A%5Cn%5Cr%5D%2B%3A%5B%5E%3A%5Cn%5Cr%5D%2A%24%29.%2A%29%2A%29%2Fm'
    4     1        ASSIGN                                                   !1, 'Name%3A+John+Doe%0A%0AAge%3A+23%0A%0APrimary+Language%3A+English%0A%0ADescription%3A+This+is+a+multiline%0Adescription+field+that+I+want+%0Ato+capture+Fri%2C+02+Sep+2022+14%3A46%3A45+-0500%0A%0ACountry%3A+Canada'
   16     2        INIT_FCALL                                               'preg_match_all'
          3        SEND_VAR                                                 !0
          4        SEND_VAR                                                 !1
          5        SEND_REF                                                 !2
          6        SEND_VAL                                                 2
          7        SEND_VAL                                                 0
          8        DO_ICALL                                                 
   18     9        INIT_FCALL                                               'print_r'
         10        SEND_VAR                                                 !2
         11        DO_ICALL                                                 
         12      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
130.81 ms | 1010 KiB | 15 Q