From: "Mauricio Fernández" Date: 2003-04-17T06:49:19+09:00 Subject: Re: [Q] Reg. Expressios with "\n" On Thu, Apr 17, 2003 at 06:36:45AM +0900, Daniel Carrera wrote: > Hello, > > I'm trying to match a regular expression on a string that contains > new-line characters. > > e.g. > > >> str = "hello something \n world" > => "hello something \n world" > >> str =~ /(.*<\/html>)/ > => nil > > I want an RE that matches this string, but '.' doesn't match the \n > character. I guess I could replace the \n's by something else, but I'd > rather not alter the original string if I can avoid it. > > Any ideas? Multiline mode: /./m -- _ _ | |__ __ _| |_ ___ _ __ ___ __ _ _ __ | '_ \ / _` | __/ __| '_ ` _ \ / _` | '_ \ | |_) | (_| | |_\__ \ | | | | | (_| | | | | |_.__/ \__,_|\__|___/_| |_| |_|\__,_|_| |_| Running Debian GNU/Linux Sid (unstable) batsman dot geo at yahoo dot com Never trust an operating system you don't have sources for. ;-) -- Unknown source