From: "M.D." Date: 2006-05-25T07:26:55+09:00 Subject: Re: RegExp Problem John W. Long wrote: > A LeDonne wrote: >>> -A >> >> Better: re = /(['"])(?:.*\1)(.*\1!)/ > > But the point is to match any quoted expression followed by an > exclamation point. The string: > > %{ "this looks like "fun"!" } > > Is only to demonstrate an expression that I was having trouble greping. > Your expression would require a quote and then a quoted expression > followed by an exclamation point--not exactly what I was looking for. John, I wonder if this also does the job: re = /['"][\w\s]*\W*['"]!/ md = re.match %{ "this looks like ' a fun test !? '!" } puts md[0] M.D. -- Posted via http://www.ruby-forum.com/.