php.net |  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
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: 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

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-12-27 13:01 UTC] mfischer@php.net
Please ask support questions at php-general@lists.php.net .

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: Sun Dec 08 15:01:28 2024 UTC