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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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

Pull Requests

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: Sun Dec 22 01:01:30 2024 UTC