From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?B?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= Subject: Re: [RFC PATCH] git-send-email: Validate recipient_cmd (to-cmd, cc-cmd) addresses Date: Thu, 21 Apr 2011 00:29:24 +0200 Message-ID: References: <20110419215239.GA22632@elie> <1303268630.24766.9.camel@Joe-Laptop> <1303336253.24766.34.camel@Joe-Laptop> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Thiago Farina , Jonathan Nieder , Git Mailing List , Nguyen Thai Ngoc Duy , Stephen Boyd To: Joe Perches X-From: git-owner@vger.kernel.org Thu Apr 21 00:29:41 2011 Return-path: Envelope-to: gcvg-git-2@lo.gmane.org Received: from vger.kernel.org ([209.132.180.67]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QCftz-0000BP-89 for gcvg-git-2@lo.gmane.org; Thu, 21 Apr 2011 00:29:39 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751926Ab1DTW30 convert rfc822-to-quoted-printable (ORCPT ); Wed, 20 Apr 2011 18:29:26 -0400 Received: from mail-fx0-f46.google.com ([209.85.161.46]:47424 "EHLO mail-fx0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751478Ab1DTW3Z convert rfc822-to-8bit (ORCPT ); Wed, 20 Apr 2011 18:29:25 -0400 Received: by fxm17 with SMTP id 17so661493fxm.19 for ; Wed, 20 Apr 2011 15:29:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=aRExWnCIgTvcA6DE9cb5ZPwWMWkuWDX+BYegm3Yb3rM=; b=YrqFinePfjMqVv85APNcZ4Axh3Npm0cE3HbQcAq1qKtA6yu41nxBKXEfJ7LSSq82PG KuLJtYgE7dm036yUveoSKl18OzBf3Hq9qEvrsvWol8Zt2TJqFByUc0NgxMPOea27b2Gc yI6yH5lXTwpko1cV2JLeJUJEumlUBNU0u5AF4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=eDRuMjjZlShIhas24y14tiqh/1GonyANFOsib5ZJkad+YbmVP2fYGMNdpqQsAofsG4 V5bQmTWxzTX9ElHZDCpou4SflSFuLzUVcSrOVmXVU3JrvvhHIRegi14bvaIex1R4xszi E4eQkQbscJI6fwxZ1i7L9iIbzndevF2T8lxBc= Received: by 10.223.54.219 with SMTP id r27mr2623824fag.124.1303338564626; Wed, 20 Apr 2011 15:29:24 -0700 (PDT) Received: by 10.223.105.201 with HTTP; Wed, 20 Apr 2011 15:29:24 -0700 (PDT) In-Reply-To: <1303336253.24766.34.camel@Joe-Laptop> Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: On Wed, Apr 20, 2011 at 23:50, Joe Perches wrote: > + =C2=A0 =C2=A0 =C2=A0 my ($recipient_name, $recipient_addr) =3D ($re= cipient =3D~ /^\s*(.*?)\s*(<[^>]+>)/); In Perl you can write (<.*?>) instead of (<[^>]+>) > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if ($recipient =3D= ~ /^\s*(.+\@\S*).*$/) { If this program doesn't have some extract_emails_from_string() function already it probably should.