From owner-freebsd-questions@FreeBSD.ORG Wed Sep 9 16:22:46 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1C2851065676 for ; Wed, 9 Sep 2009 16:22:46 +0000 (UTC) (envelope-from danielby@slightlystrange.org) Received: from mtaout01-winn.ispmail.ntl.com (mtaout01-winn.ispmail.ntl.com [81.103.221.47]) by mx1.freebsd.org (Postfix) with ESMTP id 7292C8FC12 for ; Wed, 9 Sep 2009 16:22:45 +0000 (UTC) Received: from aamtaout02-winn.ispmail.ntl.com ([81.103.221.35]) by mtaout01-winn.ispmail.ntl.com (InterMail vM.7.08.04.00 201-2186-134-20080326) with ESMTP id <20090909162244.RHRH6742.mtaout01-winn.ispmail.ntl.com@aamtaout02-winn.ispmail.ntl.com> for ; Wed, 9 Sep 2009 17:22:44 +0100 Received: from catflap.slightlystrange.org ([82.21.101.171]) by aamtaout02-winn.ispmail.ntl.com (InterMail vG.2.02.00.01 201-2161-120-102-20060912) with ESMTP id <20090909162244.QWUX21638.aamtaout02-winn.ispmail.ntl.com@catflap.slightlystrange.org> for ; Wed, 9 Sep 2009 17:22:44 +0100 Received: by catflap.slightlystrange.org (Postfix, from userid 106) id BD00D618A; Wed, 9 Sep 2009 17:22:41 +0100 (BST) Received: from torus.slightlystrange.org (torus.slightlystrange.org [10.1.3.50]) by catflap.slightlystrange.org (Postfix) with SMTP id 490876152 for ; Wed, 9 Sep 2009 17:22:41 +0100 (BST) Received: by torus.slightlystrange.org (sSMTP sendmail emulation); Wed, 9 Sep 2009 17:21:46 +0100 From: "Daniel Bye" Date: Wed, 9 Sep 2009 17:21:46 +0100 To: freebsd-questions@freebsd.org Message-ID: <20090909162146.GB96342@torus.slightlystrange.org> Mail-Followup-To: freebsd-questions@freebsd.org References: <4AA7D49D.8090002@mykitchentable.net> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="f2QGlHpHGjS2mn6Y" Content-Disposition: inline In-Reply-To: <4AA7D49D.8090002@mykitchentable.net> User-Agent: Mutt/1.4.2.3i X-PGP-Fingerprint: D349 B109 0EB8 2554 4D75 B79A 8B17 F97C 1622 166A X-Operating-System: FreeBSD 8.0-BETA4 i386 X-Cloudmark-Analysis: v=1.0 c=1 a=kXY3MdDddYIA:10 a=ehNlctqhnw0A:10 a=6p5f0Y0VS_xlTfLEUc8A:9 a=B4eaRQ7EmijyjrW0to4A:7 a=GNVlJnMnMZQ_ZJE43n8L_8_pz2YA:4 a=YdRfokINB6eMR0MEU6YA:9 a=cu2dzZz3X5QUxsroiiSvSfTHSI8A:4 Subject: Re: Regex Help - Greedy vs. Non-Greedy X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Daniel Bye List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Sep 2009 16:22:46 -0000 --f2QGlHpHGjS2mn6Y Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Sep 09, 2009 at 09:15:25AM -0700, Drew Tomlinson wrote: > I'm trying to do a search and replace in vim. I have lines like this: > http://site1/dir/; > http://site2/dir/;LastName, FirstName;Phone; > http://site3/dir/;LastName, FirstName; > http://site4/dir/; >=20 > I'm want to match "http:*" and stop matching at the first ";". My basic= =20 > regex is: >=20 > /http:.\+;/ >=20 > But it's matching *all* the semi-colons. Thus I've Googled and tried=20 > various incatations to try and make my regex "non-greedy" but I can't=20 > seem to come up with the correct combination. >=20 > How can I write a regex that stops matching at the first semi-colon? Tested in vi, not vim: /http:[^;]*/ Dan --=20 Daniel Bye _ ASCII ribbon campaign ( ) - against HTML, vCards and X - proprietary attachments in e-mail / \ --f2QGlHpHGjS2mn6Y Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.13 (FreeBSD) iEYEARECAAYFAkqn1hoACgkQixf5fBYiFmp4CwCfdwHoN+8z6TMnlGNdgSssx8D3 0q4AoL6jtpcdjsgOYJqzE6JIeHkkSxEe =mD/3 -----END PGP SIGNATURE----- --f2QGlHpHGjS2mn6Y--