From: Stefan Rusterholz Date: 2007-08-08T09:28:08+09:00 Subject: Re: Alternate Regular Expressions? Kenneth McDonald wrote: > the biggest problem with regular expressions in most languages isn't the > syntax, but rather > the inability to easily compose small REs into larger REs. Which is why > so many programs end > up with huge, unreadable REs. You can do that in ruby rather simply: # example taken from an example earlier in this thread name = /[a-z]+/i host = /[a-z]+/i tld = /com|net|org|edu/ input.scan(%r{\b#{name}@#{host}\.#{tld}\b}) do |match| puts "Found email address #{match}" end Regards Stefan -- Posted via http://www.ruby-forum.com/.