私は現在、以下の「タイプ」の内容を一致させるのに苦労しています:すべての "種類"を一致させ、正規表現を正しくエスケープするにはどうすればよいですか?
(Type): multiplechoice
(Category): 0
(Random answers): 0
(Question): Which of the following is true about pre-test imagery?
(Type): multiplechoice
(Category): 0
(Random answers): 1
(Question): Which of the following is not true about the TMJ?
私がしようとしています:エラーメッセージとして「\」
preg_match_all("(Type)\:(.+?)\n", $content, $types);
をしかし、私は未知の修飾子を取得します。
どのようにすべてのタイプを正しく一致させることができますか?何かヒントありがとう!これが何をすべき
可能な重複20705399/warning-preg-replace-unknown-modifier) – revo
正規表現でPHPでデリミタを使用する必要があります。 http://php.net/manual/en/regexp.reference.delimiters.phpまた特殊正規表現文字 '()'をエスケープする必要があります。 – chris85