help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: regexp newline issue


From: John Paul Wallington
Subject: Re: regexp newline issue
Date: Mon, 28 Nov 2005 04:44:47 +0000
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (windows-nt)

cstacy@news.dtpq.com (Christopher C. Stacy) writes:

> 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.

I think you wanna zap all the whitespace chars from your "foo bar"
string first (eg: so that it's "foobar") before doing the
`replace-regexp-in-string' hack on it.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]