php の正規表現で、後方参照の際\\n
で表現していたのですが、マニュアル(\n
で表現)と整合性がとれません。
これは何が影響しているのでしょうか?
php
1// \\nで表現 2preg_match( 3 "/(sens|respons)e and \\1ibility/", 4 "response and responsibility", 5 $out); 6var_dump($out); 7 8array(2) { 9 [0]=> 10 string(27) "response and responsibility" 11 [1]=> 12 string(7) "respons" 13}
php
1//マニュアルとおり\nで表現 2preg_match( 3 "/(sens|respons)e and \1ibility/", 4 "response and responsibility", 5 $out); 6var_dump($out); 7 8array(0) { 9}
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
退会済みユーザー
2017/08/15 02:40
2017/08/15 02:45
退会済みユーザー
2017/08/15 03:00