(.*)\n/",$line,$matches) !== " /> (.*)\n/",$line,$matches) !== " /> (.*)\n/",$line,$matches) !== "/>

Can't match "> quote"

48 Views Asked by At

I'm trying to match everything after a blockquote mark (>), but for whatever reason it's not working.

if (preg_match("/> (.*)\n/",$line,$matches) !== false){
    echo $matches[1];
}

I tried matching things after some other marks and all of them worked with the same function for example:

if (preg_match("/# (.*)\n/",$line,$matches) !== false){
    echo $matches[1];
}

works fine.

Any ideas?

1

There are 1 best solutions below

0
AudioBubble On
<?php
$line='<b>huh</b>yep yes';
preg_match('/\/.*>(.*)(\n*)/mi',$line,$matches);
print_r($matches);// echo $matches[1];
?>

i run your code inside a place where usually isn't design to run php. (i wrote a text filter that act as a plugin inside EditPlus [made inside free Koreea] )

enter image description here