php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #19581 Time for PHP to document regular expression syntax
Submitted: 2002-09-24 13:06 UTC Modified: 2002-09-24 13:31 UTC
From: phpbugs at localpin dot com Assigned:
Status: Not a bug Package: Documentation problem
PHP Version: 4.2.3 OS: All
Private report: No CVE-ID: None
 [2002-09-24 13:06 UTC] phpbugs at localpin dot com
I know maybe nobody wants to take on the task of properly documenting regular expressions, but, hey, is the following (taken from the PHP site documentation) REALLY the best that can be done:

"PHP uses the POSIX extended regular expressions as defined by POSIX 1003.2. For a full description of POSIX regular expressions see the regex man pages included in the regex directory in the PHP distribution. It's in manpage format, so you'll want to do something along the lines of man /usr/local/src/regex/regex.7 in order to read it."

I simply think that the described document, or at least the essence of its contents, should be included on the website.

I am, I think, a typical PHP user - I use PHP, and when I want documentation on a PHP item, I go to the PHP website.  To be greeted by such statements is absurd.  Even if I thought I understood what it was suggesting, you seriously cannot be expecting the average PHP programmer to really do what is suggested?

Regular expressions are voodoo as it is, without making the eager new magician perform fantastic magic even to be able to find the book of spells.

Generally, the PHP documentation is fantastic.  The search facility is wonderful.  It is well structured.  It is comprehensive.  It is complete.

But this part on regular expressions is abysmal.

Specifically, what I would like to see (I have never seen the above documentation, so I don't know what is in it), is a proper description of each of the possible values within a regular expression, including the 'magic' values like [:alphanum:], with plenty of good examples.

It perhaps needs several pages organised in a structured way to cover the complex topic.

I understand when faced with the task, the early documenters held their hands up in horror at the large task.  But, in my humble opinion, this is a gaping hole in an otherwise excellent documentation.  I say it is time for the hole to be filled.

Thanks!


Hugh Prior

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-09-24 13:16 UTC] phpbugs at localpin dot com
The exact page to which I am referring is:

http://www.php.net/manual/en/ref.regex.php
 [2002-09-24 13:31 UTC] rasmus@php.net
Well, we also don't document SQL or most other features that come from external libraries/packages.  There is nothing PHP-specific about the regular expressions on PHP.  The preg_* syntax is documented at http://www.pcre.org/man.txt and the ereg_* is straight POSIX 1003.2 which is widely documented.  If someone was to sit down and write better regular expression docs, then they would probably not end up in the php docs anyway but rather at pcre.org or as an addendum to the POSIX spec.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 24 09:01:34 2024 UTC