|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2016-02-13 08:46 UTC] kurt at kwnet dot at
[2016-02-13 08:59 UTC] requinix@php.net
-Status: Open
+Status: Not a bug
[2016-02-13 08:59 UTC] requinix@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 07 14:00:01 2026 UTC |
Description: ------------ Search for "," (any character) seems not to include linebreak. => wrong behaviour Test script: --------------- //search without newline: correct behaviour $subject="<tag>Hello World</tag>"; echo "[".preg_match('/<tag>[A-Za-z\\s]*<\\/tag>/',$subject)."]\n"; //[1] echo "[".preg_match('/<tag>[^<]*<\\/tag>/',$subject)."]\n"; //[1] echo "[".preg_match('/<tag>.*<\\/tag>/',$subject)."]\n"; //[1] //search with newline: different behaviour on using "." $subject="<tag>Hello\nWorld</tag>"; echo "[".preg_match('/<tag>[A-Za-z\\s]*<\\/tag>/',$subject)."]\n"; //[1] echo "[".preg_match('/<tag>[^<]*<\\/tag>/',$subject)."]\n"; //[1] echo "[".preg_match('/<tag>.*<\\/tag>/',$subject)."]\n"; //[0] WRONG RESULT