0
爲什麼目標字符串中的尖括號會否定第二個示例中的匹配文本。帶尖括號的意外預浸行爲
$str = '[example1](example2)';
echo preg_replace('/\[(.*?)\]\((.*)\)/', '$2 $1', $str);
// output: example2 example1
$str = '[example1](<example2>)';
echo preg_replace('/\[(.*?)\]\((.*)\)/', '$2 $1', $str);
// output: example1
omg!該睡了 ;) – esryl