From owner-freebsd-questions Mon Mar 18 18:54:50 2002 Delivered-To: freebsd-questions@freebsd.org Received: from titus.lastamericanempire.com (dsl081-101-239.den1.dsl.speakeasy.net [64.81.101.239]) by hub.freebsd.org (Postfix) with ESMTP id BE23737B400 for ; Mon, 18 Mar 2002 18:54:46 -0800 (PST) Received: by titus.lastamericanempire.com (Postfix, from userid 1000) id 34E4520FC6; Mon, 18 Mar 2002 20:02:22 -0700 (MST) Date: Mon, 18 Mar 2002 20:02:22 -0700 From: Zach Thompson To: ekoz Cc: freebsd-questions@FreeBSD.ORG Subject: Re: perl question Message-ID: <20020318200222.A6691@lastamericanempire.com> References: <001c01c1cee9$54b626d0$d4e18aca@melsa.net.id> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <001c01c1cee9$54b626d0$d4e18aca@melsa.net.id>; from ekoz@melsa.net.id on Tue, Mar 19, 2002 at 08:56:47AM +0700 X-Mailer: Mutt http://www.mutt.org/ Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG * ekoz [020318 19:07]: > Hi All, > > I have a little problem with perl. I try to delete a few line in a file with perl. I have a following line : > > cs > cs.tpkkoja > > I use "s/\bcs\b/ /;" to deleting the word "cs" and i don't want to deleting "cs.tpkkoja" but, i get this result : > > .tpkkoja > all the word "cs" is deleted include in "cs.tpkkoja". > Any Suggestions ? If the "cs" you want to delete is always on a line of itself: s/^cs$//; You could add other things like checking for leading/trailing whitespace too. Zach Thompson To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message