Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:53777 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 44088 invoked from network); 8 Jul 2011 12:12:43 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Jul 2011 12:12:43 -0000 Authentication-Results: pb1.pair.com smtp.mail=listas@rafaeldohms.com.br; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=listas@rafaeldohms.com.br; sender-id=unknown Received-SPF: error (pb1.pair.com: domain rafaeldohms.com.br from 209.85.212.42 cause and error) X-PHP-List-Original-Sender: listas@rafaeldohms.com.br X-Host-Fingerprint: 209.85.212.42 mail-vw0-f42.google.com Received: from [209.85.212.42] ([209.85.212.42:53497] helo=mail-vw0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 3B/40-38520-834F61E4 for ; Fri, 08 Jul 2011 08:12:41 -0400 Received: by vwl1 with SMTP id 1so1526776vwl.29 for ; Fri, 08 Jul 2011 05:12:37 -0700 (PDT) MIME-Version: 1.0 Received: by 10.52.107.33 with SMTP id gz1mr1735588vdb.153.1310127157834; Fri, 08 Jul 2011 05:12:37 -0700 (PDT) Received: by 10.52.113.165 with HTTP; Fri, 8 Jul 2011 05:12:37 -0700 (PDT) Date: Fri, 8 Jul 2011 09:12:37 -0300 Message-ID: To: PHP internals Content-Type: text/plain; charset=ISO-8859-1 Subject: preg_match From: listas@rafaeldohms.com.br (Rafael Dohms) I was wondering if anyone ever thought of either fixing or writing a new function that would make preg_match actually work in a way that made sense? right now i need to pass in a optional parameter that will receive the match, in this case one or no match, why should this not be the function's return already? something like: $string = "my text"; $result = preg_match("/\(.*)\<\/td\>/", $string); $result // = "my text" Maybe something like preg_extract? I do not have the C skills to write a patch but i think adding a new function would not break BC or have negative side effects, would it? -- Rafael Dohms PHP Evangelist and Community Leader http://www.rafaeldohms.com.br http://www.phpsp.org.br