|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #14723 ereg doesn't match correct
Submitted: 2001-12-27 10:26 UTC Modified: 2001-12-27 13:18 UTC
From: sow dot olivier at alias dot fr Assigned:
Status: Not a bug Package: *Regular Expressions
PHP Version: 4.0.5 OS: WIN2K
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.
Block user comment
Status: Assign to:
Bug Type:
From: sow dot olivier at alias dot fr
New email:
PHP Version: OS:


 [2001-12-27 10:26 UTC] sow dot olivier at alias dot fr
I try to build an expression to get the File Name from a string given by ftp_rawlist()

$pFile="-rwxrwxrwx 1 owner group 35087 Aug 13 1999 Copy of fupgrade.asf";
ereg("^.+ ([0-9]) .+ ([0-9]+) (.+) ([0-9][0-9]) ([0-9][0-9](:*)[0-9][0-9]) (.+)$",$pFile, $regs);

this expression doesn't return match
i try this one:

ereg("^.+ ([0-9]) .+ ([0-9]+) (.+) ([0-9][0-9]) ([0-9]+) (.+)$",$pFile, $regs);

but doesn't work too

the first expression works on these string:
"-rwxrwxrwx 1 owner group 3163 Dec 27 14:18 Read me & me.txt"
"drwxrwxrwx 1 owner group 0 Dec 27 14:06 test2"

but if i replace the hour by the year (as do ftp_rawlist())
that not work even with the second expression


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2001-12-27 13:01 UTC]
Please ask support questions at .

Hint: You may want to use preg_match or even skip the regex part and use explode/split on (white)spaces.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Jun 17 23:01:29 2024 UTC