Edit report at https://bugs.php.net/bug.php?id=61958&edit=1
ID: 61958 User updated by: kulakov74 at yandex dot ru Reported by: kulakov74 at yandex dot ru Summary: Trailing linebreak ignored Status: Open Type: Bug Package: PCRE related Operating System: Linux, Windows 7 PHP Version: 5.3.12 Block user comment: N Private report: N New Comment: Sorry, the title should be "preg_match() ignores trailing linebreak" Previous Comments: ------------------------------------------------------------------------ [2012-05-06 04:19:53] kulakov74 at yandex dot ru Description: ------------ I want to check if a string is a single wordcharacter but even it has a trailing linebreak preg_match() returns 1. Test script: --------------- echo preg_match('~^\w$~', "a\n"); Expected result: ---------------- 0 Actual result: -------------- 1 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=61958&edit=1