Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!lll-winken!uunet!mcvax!hp4nl!ruuinf!piet From: piet@ruuinf (Piet van Oostrum) Newsgroups: gnu.emacs Subject: Re: Matching multiple lines with regex Message-ID: <1200@ruuinf.UUCP> Date: 16 Mar 89 08:33:10 GMT References: <768@pcsbst.UUCP> Sender: piet@ruuinf.UUCP Reply-To: piet@ruuinf (Piet van Oostrum) Organization: Dept of Computer Science, University of Utrecht, Holland Lines: 22 In-reply-to: jkh@pcsbst.UUCP (jkh) In article <768@pcsbst.UUCP>, jkh@pcsbst (jkh) writes: ` `I'm using the regex code out of 18.52 and would like to construct a `regular expression that will match *all* of the characters in a string `of text containing newlines. I tried ".*" (the most obvious), but it `just matches up to the first newline. The definition of '.' in r.e's is any character except newline: `. (Period)' is a special character that matches any single character except a newline. Using concatenation, we can make regular expressions like `a.b' which matches any three-character string which begins with `a' and ends with `b'. So use (in Lisp syntax): "\\(.\\|\n\\)*" -- Piet van Oostrum, Dept of Computer Science, University of Utrecht Padualaan 14, P.O. Box 80.089, 3508 TB Utrecht, The Netherlands Telephone: +31-30-531806. piet@cs.ruu.nl (mcvax!hp4nl!ruuinf!piet)