3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = 'Blablabla Beginning Text <u>\\n\\\\*HYPERLINK \\"http://www.youtube.com/watch?v=A0VUsoeT9aM\\"1.A Youtube Video</u> blablabla Text Middle <u>\\n\\\\*HYPERLINK \\"http://www.youtube.com/watch?v=A0VUsoeT9aQ\\"2. A Youtube Video</u> blabla Text after'; $newpattern = '/(http[?.:=\w\d\\/]*)\\\\"([\s\w.]+)</'; print "does the pattern work?\n"; preg_match_all($newpattern, $string, $allMatches); var_dump($allMatches); print "yep!\n\n"; $newReplace = '<a href="\\1">\\2</a>'; var_dump( preg_replace($newpattern, $newReplace, $string) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LdIri
function name:  (null)
number of ops:  22
compiled vars:  !0 = $string, !1 = $newpattern, !2 = $allMatches, !3 = $newReplace
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'Blablabla+Beginning+Text+%3Cu%3E%5Cn%5C%5C%2AHYPERLINK+%5C%22http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DA0VUsoeT9aM%5C%221.A+Youtube+Video%3C%2Fu%3E+blablabla+Text+Middle+%3Cu%3E%5Cn%5C%5C%2AHYPERLINK+%5C%22http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DA0VUsoeT9aQ%5C%222.+A+Youtube+Video%3C%2Fu%3E+blabla+Text+after'
    5     1        ASSIGN                                                   !1, '%2F%28http%5B%3F.%3A%3D%5Cw%5Cd%5C%2F%5D%2A%29%5C%5C%22%28%5B%5Cs%5Cw.%5D%2B%29%3C%2F'
    7     2        ECHO                                                     'does+the+pattern+work%3F%0A'
    8     3        INIT_FCALL                                               'preg_match_all'
          4        SEND_VAR                                                 !1
          5        SEND_VAR                                                 !0
          6        SEND_REF                                                 !2
          7        DO_ICALL                                                 
    9     8        INIT_FCALL                                               'var_dump'
          9        SEND_VAR                                                 !2
         10        DO_ICALL                                                 
   10    11        ECHO                                                     'yep%21%0A%0A'
   12    12        ASSIGN                                                   !3, '%3Ca+href%3D%22%5C1%22%3E%5C2%3C%2Fa%3E'
   13    13        INIT_FCALL                                               'var_dump'
         14        INIT_FCALL                                               'preg_replace'
         15        SEND_VAR                                                 !1
         16        SEND_VAR                                                 !3
         17        SEND_VAR                                                 !0
         18        DO_ICALL                                         $9      
         19        SEND_VAR                                                 $9
         20        DO_ICALL                                                 
         21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.65 ms | 1395 KiB | 19 Q