Jump to content

[SOLVED] why doesn't this simple regex match?


dsaba

Recommended Posts

<?php
$str = '" \\an//d " " \\an//d "';
echo "$str<br>";
$pat = '~(" )(\\an//d)( ")~e';
preg_match_all($pat, $str, $out);
print_r($out);
?>

 

outputs:

" \an//d " " \an//d "<br>
Array
(
    [0] => Array
        (
        )

    [1] => Array
        (
        )

    [2] => Array
        (
        )

    [3] => Array
        (
        )

)

 

Why doesn't it match? (read it carefully)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.