From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: kai.grossjohann@uni-duisburg.de (Kai =?iso-8859-1?q?Gro=DFjohann?=) Newsgroups: gmane.emacs.help Subject: Re: replacing whitespace (regexp question) Date: Mon, 17 Feb 2003 20:49:34 +0100 Organization: University of Duisburg, Germany Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <84lm0evga9.fsf@lucy.is.informatik.uni-duisburg.de> References: <8c5b0e7f.0302171028.6f43c004@posting.google.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1045512027 20420 80.91.224.249 (17 Feb 2003 20:00:27 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 17 Feb 2003 20:00:27 +0000 (UTC) Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18krR3-0005Il-00 for ; Mon, 17 Feb 2003 21:00:17 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18krMq-00020C-0A for gnu-help-gnu-emacs@m.gmane.org; Mon, 17 Feb 2003 14:55:56 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!headwall.stanford.edu!fu-berlin.de!uni-berlin.de!pd9e1e995.dip.t-dialin.NET!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 15 Original-NNTP-Posting-Host: pd9e1e995.dip.t-dialin.net (217.225.233.149) Original-X-Trace: fu-berlin.de 1045511427 49807708 217.225.233.149 (16 [73968]) User-Agent: Gnus/5.090016 (Oort Gnus v0.16) Emacs/21.3.50 Cancel-Lock: sha1:/7UPWToe8qwW5zvJZNaEmHcQ0us= Original-Xref: shelby.stanford.edu gnu.emacs.help:110307 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:6811 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:6811 q8e192@yahoo.com (Henry Chan) writes: > How do I replace the whitespace at the beginning of a line with nothing > i.e. > I want to perform something like: > $str =~ s#^\s+##; First of all, you can replace the regexp ^\s-+ with nothing, using query-replace-regexp. Secondly, C-x h C-u - 999 C-x C-i might be useful, as well. (If you have lines starting with more than 999 spaces, it won't work. But I'm sure you can guess what to do in that case.) -- A turnip curses Elvis