|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #3014 octal character versus regex backreferences
Submitted: 1999-12-20 21:18 UTC Modified: 2001-02-10 13:55 UTC
From: cmiller at surfsouth dot com Assigned:
Status: Closed Package: Feature/Change Request
PHP Version: 3.0 Latest CVS (20/12/1999) OS: any
Private report: No CVE-ID: None
 [1999-12-20 21:18 UTC] cmiller at surfsouth dot com
ereg("fla(r[gpm]) wobba\1", $foo)

Note the ``\1'' -- is that an octal 1 in my charset, or a backreference?

The backslash-x-number notation is great for hexidecimal, but the backslash-number notation conflicts with the notation for backreferences (in ereg(), e.g.)

Are there backreferences?  The manual refers us to the regex(7) manpage, which does describe them.

Even if there's not, I recommend backslash-zero-octal, as historically, octals are represented with preceding zeros.  Backreferences are positive integers (which mortals usually describe with no leading zero), so there's no conflict.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2001-02-10 13:55 UTC]
the backreference needs a double backslash, and then there's no confusion.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Jul 16 03:01:27 2024 UTC