Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
PHPで使用している正規表現がいくつかあります:
preg_match_all('/D3m57D3m58(.+)D3m59/Uis', $content, $m)
これはほとんどのもので問題なく機能しますが、一部の例 D3m57でD3m58は、改行で区切られている可能性があるため、一致しません。
D3m57
D3m58
それらの間に新しい行があってもこれを一致させるにはどうすればよいですか?
一致する文字列を変更できません
または のいずれか?に一致する量指定子を使用して、それらの間にオプションの改行を追加します。01
?
0
1
preg_match_all('/D3m57\n?D3m58(.+)D3m59/Uis', $content, $m)