[PHP] preg_grep

2002-10-15 Thread Mark Harwood
Hi All, I've written a inifile class and was trying to improve it but got stuck trying to read all the sections: [Section 1] name=value [Section 2] name=value $Inifile is the inifile read into an array but the following doesn't work: $Sections = preg_grep(/(?=^\[)([^\[\]]+)(?=\]$)/i,

[PHP] preg_grep Help (Regular expresion)

2002-05-11 Thread Brian C. Doyle
Hello all, I have a file that has ip address in it.. I need to pull those ip addresses out. Currently I am trying: $ips=preg_grep(/^([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)/,$file); print_r(array_values ($ips)); And well i am getting nothing! Anyone? -- PHP General Mailing List

[PHP] preg_grep() and limit parameter

2001-12-18 Thread Andrei Zmievski
Does anyone see a need for a limit parameter to preg_grep() that would limit the number of array entries returned? -Andrei * My wishlist: http://www.amazon.com/exec/obidos/wishlist/2Q2DIPY7BZLSH/ * -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For

RE: [PHP] preg_grep() and limit parameter

2001-12-18 Thread Jack Dempsey
-Original Message- From: Andrei Zmievski [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 18, 2001 12:40 PM To: [EMAIL PROTECTED] Subject: [PHP] preg_grep() and limit parameter Does anyone see a need for a limit parameter to preg_grep() that would limit the number of array entries returned? -Andrei

[PHP] preg_grep changed after php4.0.4+

2001-11-04 Thread alanjc45
It does not appear to be in the documentation yet (and only a little blurb in the NEWS file) but preg_grep has changed. Assume $file_list is an array of file names using integer keys, e.g., $file_list { 0 = test, 1 = filenames } $result = preg_grep(/name/i, $file_list); Here is an example of