php.net |  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
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: cmiller at surfsouth dot com
New email:
PHP Version: OS:

 

 [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.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-02-10 13:55 UTC] jimw@php.net
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 Apr 23 17:01:31 2024 UTC