php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #65890 PCRE escape sequence \R undocumented
Submitted: 2013-10-13 15:54 UTC Modified: 2018-03-21 13:35 UTC
Votes:3
Avg. Score:4.3 ± 0.5
Reproduced:2 of 2 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: krewecherl at gmail dot com Assigned:
Status: Open Package: PCRE related
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2013-10-13 15:54 UTC] krewecherl at gmail dot com
Description:
------------
This manual page on PCRE escape sequences

   http://www.php.net/manual/en/regexp.reference.escape.php

is missing the \R (BSR, backslash-R) escape. One of the user comments mentions it, but not quite correctly. Whether \R matches only CR, NL, and CR+LF, or *any* Unicode line break sequence, depends on how the pcre extension is configured (flag: --enable-bsr-anycrlf), see the README in ext/pcre/pcrelib.

The default mode is BSR_UNICODE, in which \R matches \r, \n, \r\n, U+0085, U+2028, and U+2029. I can confirm this for the default Ubuntu packages, but I don't have any information about other distributions/packages.

In any case, the escape sequence should be documented.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-01-28 12:26 UTC] cmb@php.net
-Package: Documentation problem +Package: PCRE related
 [2018-03-21 13:35 UTC] cmb@php.net
The \R escape sequence has been documented in the meantime[1], but
the details are even more complex than reported in this ticket[2].

See also bug #62360.

[1] <http://svn.php.net/viewvc?view=revision&revision=339182>
[2] <https://nikic.github.io/2011/12/10/PCRE-and-newlines.html>
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sat Sep 21 09:01:27 2019 UTC