From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: cstacy@news.dtpq.com (Christopher C. Stacy) Newsgroups: gmane.emacs.help Subject: regexp newline issue Date: Mon, 28 Nov 2005 01:03:19 GMT Message-ID: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1133139976 4077 80.91.229.2 (28 Nov 2005 01:06:16 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 28 Nov 2005 01:06:16 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Nov 28 02:06:11 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EgXT7-00069w-7y for geh-help-gnu-emacs@m.gmane.org; Mon, 28 Nov 2005 02:06:09 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EgXT6-0005w8-Jq for geh-help-gnu-emacs@m.gmane.org; Sun, 27 Nov 2005 20:06:08 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!130.81.64.211.MISMATCH!cycny01.gnilink.net!spamkiller2.gnilink.net!gnilink.net!trndny06.POSTED!8b1f9295!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (darwin) Cancel-Lock: sha1:CQZHoywm4st+R1lYwjQNao9h6Aw= Original-Lines: 38 Original-NNTP-Posting-Host: 68.163.196.89 Original-X-Complaints-To: abuse@verizon.net Original-X-Trace: trndny06 1133139799 68.163.196.89 (Sun, 27 Nov 2005 20:03:19 EST) Original-NNTP-Posting-Date: Sun, 27 Nov 2005 20:03:19 EST Original-Xref: shelby.stanford.edu gnu.emacs.help:135834 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:31437 Archived-At: I want to search for a string like "foo bar", but there might be whitespace (even newlines) between any of the characters. Given the string "foo bar", I tried constructing a regexp by (replace-regexp-in-string "\\(.\\)" "[\040\011\012\015]*\\1" "foo bar") but that doesn't quite do it. By the way, I originally tried whitespace syntax "\\s-" rather than character alternatives, but that seemed to work even less well. Also, I am using an older emacs that does not seem to have the named character classes. In particular, the above [tab,LF,CR] hack finds #1 and #3, but not #2, in the following examples: ---------- 1. foo bar 2. foo bar -or- 3. fo o ba r ---------- Whenever regexps involve newlines, I get confused. (OK, I admit I just get confused about almost all regexps!) TIA for your help!