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
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:
44 + 27 = ?
Subscribe to this entry?

 
 [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

Add a Patch

Pull Requests

Add a Pull Request

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-2019 The PHP Group
All rights reserved.
Last updated: Wed Jun 26 08:01:25 2019 UTC