私は現在、PHP の空の文字列で一致を取得しようとしています。この現在のランスルーは一致not
して空である必要がありますが、何らかの理由''
で一致するようにしか見えませんか? not
誰かが私が間違っていることを教えてもらえますか?
preg_match('/^\bnot|$/', 'not', $matches);
print_r($matches); // array(0 => 'not') // correct
preg_match('/^\bnot|$/', '', $matches);
print_r($matches); // array(0 => '') // maybe right ?
preg_match('/^\bnot|$/', 'foo', $matches);
print_r($matches); // array(0 => '') // deff messed up