php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #33754 The ereg function does not accept [:alpha:] as representing [a-zA-Z]
Submitted: 2005-07-18 19:05 UTC Modified: 2005-07-18 21:15 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: bryan at phprogrammer dot com Assigned:
Status: Not a bug Package: Regexps related
PHP Version: 4.3.11 OS: llinux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
37 + 38 = ?
Subscribe to this entry?

 
 [2005-07-18 19:05 UTC] bryan at phprogrammer dot com
Description:
------------
It also ignores all the rest of the metacharacters [:space:] [:alnum:] [:digit:] and so on

Reproduce code:
---------------
<?
  if(ereg("[:digit:]", "1234", $regs))
  {
    print "true";
  }
  else
  {
    print "false";
  }
?>

Expected result:
----------------
true

Actual result:
--------------
false

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-07-18 21:15 UTC] sniper@php.net
It should be like this:

if(ereg("[[:digit:]]", "1234", $regs))
..
 
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 10:01:28 2024 UTC