From owner-freebsd-questions@FreeBSD.ORG Sat Jan 10 14:33:20 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 055F116A4CE for ; Sat, 10 Jan 2004 14:33:20 -0800 (PST) Received: from smtp.infracaninophile.co.uk (happy-idiot-talk.infracaninophile.co.uk [81.2.69.218]) by mx1.FreeBSD.org (Postfix) with ESMTP id E3EEF43D1F for ; Sat, 10 Jan 2004 14:33:12 -0800 (PST) (envelope-from m.seaman@infracaninophile.co.uk) Received: from happy-idiot-talk.infracaninophile.co.uk (localhost.infracaninophile.co.uk [IPv6:::1])i0AMX8fn005050 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 10 Jan 2004 22:33:08 GMT (envelope-from matthew@happy-idiot-talk.infracaninophile.co.uk) Received: (from matthew@localhost)id i0AMX8Ac005049; Sat, 10 Jan 2004 22:33:08 GMT (envelope-from matthew) Date: Sat, 10 Jan 2004 22:33:08 +0000 From: Matthew Seaman To: Gary Kline Message-ID: <20040110223308.GA4881@happy-idiot-talk.infracaninophile.co.uk> Mail-Followup-To: Matthew Seaman , Gary Kline , FreeBSD Mailing List References: <20040110221036.GA44130@tao.thought.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="uAKRQypu60I7Lcqm" Content-Disposition: inline In-Reply-To: <20040110221036.GA44130@tao.thought.org> User-Agent: Mutt/1.5.5.1i X-Spam-Status: No, hits=-4.9 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=2.61 X-Spam-Checker-Version: SpamAssassin 2.61 (1.212.2.1-2003-12-09-exp) on happy-idiot-talk.infracaninophile.co.uk cc: FreeBSD Mailing List Subject: Re: perl script question. X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Jan 2004 22:33:20 -0000 --uAKRQypu60I7Lcqm Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Jan 10, 2004 at 02:10:36PM -0800, Gary Kline wrote: >=20 > Folks, >=20 > Let's see if perl can do this one; it's as obscure a task > as I've run into. I have scores of files with: >=20 > A regular sentence, or phrase. then_one_containing_underscores_- > between_each_word Followed by another regular, space-delimited > sentence. Followed_by_another_string_with_underscaores. >=20 > Is there a perl way to get rid of the > string_containing_underscores and leave the regular sntences?? >=20 perl -pi.bak -e 's/\s+\w+_\w+\.?//;' filename Cheers, Matthew=09 --=20 Dr Matthew J Seaman MA, D.Phil. 26 The Paddocks Savill Way PGP: http://www.infracaninophile.co.uk/pgpkey Marlow Tel: +44 1628 476614 Bucks., SL7 1TH UK --uAKRQypu60I7Lcqm Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQFAAH2kdtESqEQa7a0RAu2aAKCDEjaos2oLvq4ZJraY4MAHwbdw7wCfUNf7 TH6FwX4KoYPqkERIcxSqK8c= =QYM6 -----END PGP SIGNATURE----- --uAKRQypu60I7Lcqm--