php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #4199 Regular Expression functions do not seem to work with spaces
Submitted: 2000-04-20 11:43 UTC Modified: 2000-07-25 22:37 UTC
From: tim at orotech dot com Assigned:
Status: Closed Package: Misbehaving function
PHP Version: 4.0 Release Candidate 1 OS: Soliars 7
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: tim at orotech dot com
New email:
PHP Version: OS:

 

 [2000-04-20 11:43 UTC] tim at orotech dot com
I am using php4 RC1 to parse a file that is uploaded from a user.

file opens correctly, and all other characters are taken out when I use either ereg_replace or eregi_replace. However, 

trim($str)  
ltrim($str)
fail to remove the beginning and trailing whitespaces.

eregi_replace(" ", "", $str)
ereg_replace(" ", "", $str)
eregi_replace("[[:space:]]", "", $str)
ereg_replace("[[:space:]]", "", $str)
these also fail to remove a space at the beginning of a string that I'm reading from an uploaded text file.

I'm running:
System: SunOS jasonwolfe.com 5.7 Generic_106541-10 sun4c sparc SUNW,Sun_4_75
Apache 1.3.12
MySQL 3.22.32

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-07-25 22:37 UTC] zak@php.net
Please try a recent release of PHP.  If the problem still occurs please submit a new bug report.
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Sat Oct 10 11:00:01 2026 UTC