From: Pit Capitain Date: 2005-06-23T15:32:02+09:00 Subject: Re: Getting a list of results from one regular expression tietyt@gmail.com schrieb: > Here's my situation, I've got this long string that contains XML. I > would like to parse it. Specifically, I want to search this string for > all instances of a pattern like /stringAlias="(.*)"/ One additional remark: if the input can contain multiple stringAlias expressions on one line, the pattern should be /stringAlias="(.*?)"/ (note the question mark). You can see the difference if you match a string like str = "stringAlias=\"one\" bla stringAlias=\"two\"" p str.scan( /stringAlias="(.*)"/ ) # => [["one\" bla stringAlias=\"two"]] p str.scan( /stringAlias="(.*?)"/ ) # => [["one"], ["two"]] Regards, Pit