From: Alex Young Date: 2007-03-07T23:08:20+09:00 Subject: Re: Regular expressions - Again Harry wrote: >> You may be lucky with since it's likely to not include any >> attributes, but still there might be some whitespace INSIDE the tags, >> >> Jenda >> > > str = "This is <title> what I\n\n\n\n \n want and > no more" > p str > > str =~ /(.*?)<\/title>/m > p $1.gsub(/(\n|\s)+/, " ").strip > > I think he meant: str = "This is <title >what I want and no more" but we don't know if the problem requires handling anything more complex than simple tags. -- Alex