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:4
Avg. Score:4.0 ± 0.7
Reproduced:3 of 3 (100.0%)
Same Version:1 (33.3%)
Same OS:1 (33.3%)
From: krewecherl at gmail dot com Assigned:
Status: Open Package: PCRE related
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: krewecherl at gmail dot com
New email:
PHP Version: OS:

 

 [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-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 02:02:52 2024 UTC